Error PHP 8, Cart Module

  • Posts: 18
  • Thank you received: 2
  • Hikashop Business Hikashop Essential
1 year 8 months ago #349604

-- HikaShop version -- : 4.7.1
-- Joomla version -- : 4.2.8
-- PHP version -- : 8.x
-- Error-message(debug-mod must be tuned on) -- : Warning: Undefined property: stdClass::$cart_id in /homepages/19/d950326389/htdocs/cms/joom4/templates/gk_storefront/html/com_hikashop/product/cart.php on line 132

Hello,
i have an error message in the cart module.

Thank you and with best regards
Maurizio

the code snippet:

<form action="<?php echo hikashop_completeLink('product&task=updatecart' . $url_itemid, false, true); ?>" method="post" name="<?php echo $form; ?>">
		<div>
			<div>
				<?php
        $k                        = 0;
        $this->cart_product_price = true;
        $group                    = $this->config->get('group_options', 0);
        $cart_id                  = 0;
        $app                      = JFactory::getApplication();
        $productClass             = hikashop_get('class.product');

        $defaultParams = $this->config->get('default_params');

        $this->image = hikashop_get('helper.image');
        $height      = $this->config->get('thumbnail_y');
        $width       = $this->config->get('thumbnail_x');
        foreach ($this->rows as $i => $row) {
            $cart_id = $row->cart_id; // LINE WITH THE ISSUE
            if (empty($row->cart_product_quantity) || @$row->hide == 1)
                continue;
            if ($group && $row->cart_product_option_parent_id)
                continue;
            $productClass->addAlias($row);
?>

Attachments:
Last edit: 1 year 8 months ago by Jerome. Reason: [code] tag is NICE

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 8 months ago #349613

Hi,

This warning comes from the view override in your template.
This line is not in the default view file in HikaShop.
You could rename the file templates/gk_storefront/html/com_hikashop/product/cart.php to something else via FTP to deactivate the override, and that would fix the warning. However, you'll loose the look of your cart module.
You could also turn off the "error reporting" and "debug" settings of the joomla configuration (which should be the case normally on a live website, for security reasons) and that would hide the warning.
However, the best would be to provide the warning to your template provider's support and check with them what they recommend.

Please Log in or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 2
  • Hikashop Business Hikashop Essential
1 year 8 months ago #349623

Hello Nicolas,
i will do so and thank you for your quick reply.

Best Regards
Maurizio

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum