I want to restrict Magento to have one single product per order. If the user is trying to add more than one product to the cart it should be prohibited. I'm not talking about restricting one particular product. Generally whatever the product is, there should be one product at a time in the cart until place the order.

How can I achieve this?


3 Answers 3


In observer

class cart_restrict_Model_Observer
    public function catalogProductTypePrepare($observer)
        $quote = Mage::getSingleton('checkout/session')->getQuote();
            Mage::throwException('You can only buy one product at a time.');

you can do it by code,that is allow a product to add only if cart is empty..

create a local checkout module for overwriting core checkout module then overwrite CartController.php for addAction() method in to your local module then check this condition ,

     //session message as only one product can add to cart
    //add to cart

Hope this is what you need..


Yes, you can limit the maximum quantity of a product in the shopping cart by editing the value on the Inventory tab when editing a product. See screenshot below. In your case, you'd want to uncheck Use Config Settings and set the value to 1.

enter image description here

  • Sorry This is not the expected answer. I don't want to restrict one particular product
    – Sukeshini
    Commented Dec 23, 2014 at 6:45

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