Is there a way to only allow one item to be added to the shopping cart and then checked out.

I tried the event + observer addition in this link: How to allow only one product in a cart?

But it doesn't seem to work with V1.9.2.3 As I am still able to add more than item to the cart and make it all the way to checkout.

  • Possible duplicate of How to allow only one product in a cart? Commented Mar 12, 2016 at 10:07
  • Post related code of what you have tried.
    – benmarks
    Commented Mar 13, 2016 at 18:02
  • A created new folders under: app/code/community/CartLimit/Cart In there I made both an ect folder and a Model folder The ect folder has the config.xml and the module folder contains the observer.php file Commented Mar 18, 2016 at 17:25

2 Answers 2


he events catalog_product_type_prepare_full_options and catalog_product_type_prepare_lite_options are your friends

<?xml version="1.0"?>

Then in your Observer class

class Fooman_Example_Model_Observer
    public function catalogProductTypePrepare($observer)
        $quote = Mage::getSingleton('checkout/session')->getQuote();
            Mage::throwException('You can only buy one product at a time.');
  • I added something similar to this except it was by somebody else and where it says fooman its their signature. But I have a config file in the ect folder and then in the module folder a php file called observer with the above code Commented Mar 18, 2016 at 17:27

I don't think it's a good idea to throw error. Rather do init checkout before add product to cart will clear the old cart and create the cart with the newly added product alone. Init checkout is a child function available in mage checkout model.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.