Search code examples
phpopencart2.xopencart-module

Opencart 2.x add only single item in cart with any quantity


i want customer only add single item in her cart with any number of quantity. if cart already have item it's should be remove and newly added item add to cart in Opencart 2.x.


Solution

  • open system/library/cart.php. You will find follwoing function.

    public function add 
    

    You can run delete query at very fast in this function.