June 2, 2015

OpenCart set only one item in cart.


If you want to display only one item in cart and the add more OR update cart quantity then follow below step:

1. First edit System / library / cart.php file

2. Find below code:
$this->session->data['cart'][$key] += (int)$qty;

3. Replace with this one:
$this->session->data['cart'][$key] = (int)$qty;

So its not update cart quantity.

Enjoy!

1 comment:

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...