-- HikaShop version -- : 2.6.0
I need on all pages pages this code, this are simple all products in cart:
$this->setLayout('listing_price');
$k = 0;
$group = $this->config->get('group_options',0);
$defaultParams = $this->config->get('default_params');
$productClass = hikashop_get('class.product');
$quantityDisplayType = hikashop_get('type.quantitydisplay');
foreach($this->rows as $i => $row){
if(empty($row->cart_product_quantity)) continue;
if($group && $row->cart_product_option_parent_id) continue;
$productClass->addAlias($row);
?>
{
'name': '<?php echo strip_tags($row->product_name); ?>',
'id': '<?php echo $row->product_id; ?>',
<?php
$this->row=&$row;
$this->unit=false;
?>
'price': '<?php echo preg_replace('/\s+/', '', strip_tags($this->loadTemplate())); ?>',
'brand': 'my_brand',
'category': '',
'variant': '-',
'quantity': <?php echo $row->cart_product_quantity; ?>
}<?php if ($row != end($this->rows)) : ?>,<?php endif; ?>
<?php
$k = 1-$k;
}
But on some pages I get this error : Notice: Undefined property: CheckoutViewCheckout::$rows in PATH_TO_TEMPLATE\html\com_hikashop\checkout\step.php on line 207
What do I have to fix there to get always correct cart products?