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:

The Future of Technology: Emerging Trends to Watch in 2025

Introduction As we navigate through 2025, the technological landscape continues to evolve at an unprecedented pace. Innovations that once se...