When Adding an item to the cart then hovering over the mini cart at the header it becomes empty and shows a message "Your shopping cart is empty!".
To make it simpler I was using the code below:
Code: Select all
<file name="system/library/customer.php">
<operation>
<search position="after" offset="2"><![CDATA[
$this->session->data['customer_id'] . "' AND status = '1'");
]]></search>
<add ><![CDATA[
/**
* Mobile App code
*/
if ($customer_query->row['cart'] && is_string($customer_query->row['cart'])) {
$cart = unserialize($customer_query->row['cart']);
$this->session->data['cart'] = $cart;
}
Code: Select all
<file name="system/library/customer.php">
<operation>
<search position="after" offset="2"><![CDATA[
$this->session->data['customer_id'] . "' AND status = '1'");
]]></search>
<add ><![CDATA[
/**
* Mobile App code
*/
if ($customer_query->row['cart'] && is_string($customer_query->row['cart'])) {
$cart = unserialize($customer_query->row['cart']);
foreach ($cart as $key => $value) {
if (!array_key_exists($key, $this->session->data['cart'])) {
$this->session->data['cart'][$key] = $value;
} else {
$this->session->data['cart'][$key] += $value;
}
}
}
Anyone can help me please, thank you!