-- url of the page with the problem -- :
betascreens.com/index.php
-- HikaShop version -- : 3.4.1
-- Joomla version -- : 3.8.10
-- PHP version -- : 7.0.30
-- Browser(s) name and version -- : firefox
-- Error-message(debug-mod must be tuned on) -- : Warning: Missing argument 1 for hikashopCartClass::get(), called in /home/wetroomi/public_html/betascreens.com/tests/cart_items.php on line 7 and defined in /home/wetroomi/public_html/betascreens.com/administrator/components/com_hikashop/classes/cart.php on line 79
Notice: Undefined variable: element in /home/wetroomi/public_html/betascreens.com/administrator/components/com_hikashop/classes/cart.php on line 87
Notice: Undefined property: stdClass::$cart_product_option_parent_id in /home/wetroomi/public_html/betascreens.com/tests/cart_items.php on line 11
Notice: Undefined property: stdClass::$cart_product_quantity in /home/wetroomi/public_html/betascreens.com/tests/cart_items.php on line 12
Notice: Trying to get property of non-object in /home/wetroomi/public_html/betascreens.com/tests/cart_items.php on line 11
Hi,
I have recently taken over two sites, and subsequently updated to the latest versions of Joomla and Hikashop Business.
Both sites are using a Gantry template.
Both sites appear to have a custom solution to displaying the number of items added to the cart.
I did the Joomla update two days ago and the cart items update were still working, however following the update of Hikashop the cart items are no longer updating.
The error I have posted in this post is the same on both sites. (I have now switched error reporting off)
I have followed the error and there is a file called "cart_items.php" in a "tests" folder within the root folder.
Here is the code in the cart_items.php file:
<span style="font-family: courier new, courier, monospace;">
<?php
require_once('/home/wetroomi/public_html/diywetroom.com/administrator/components/com_hikashop/helpers/helper.php');
$class = hikashop_get('class.cart');
$rows = $class->get();
$qty = 0;
if(!empty($rows)){
foreach($rows as $k =>$row){
if($row->cart_product_option_parent_id) continue;
$qty += $row->cart_product_quantity;
}
}
echo $qty;
?>
</span>
And in the Gantry template of there is the following code:
<div id="mobile-logo">
<div class="mobile-logo-content">
<a href="/index.php"><img src="images/logo.png"></a>
</div>
</div>
<div id="cart">
<div class="items">
{source file=tests/cart_items.php}{/source}
<!--Shopping CART link -->
</div>
<div class="cart-content">
<a href="/checkout"><img src="images/icons/cart.png"></a>
</div>
</div>
I have tried turning off the cart legacy options, but this didn't seem to make any difference - I guess because this is a custom solution.
I'm not really a coder, so my knowledge is not good enough to work out how to fix this specific problem.
I would be so grateful if you anyone can help me in working out how to fix the issue, everything else appears to be working fine.
Many thanks in advance
Duncan