user2032389
user2032389

Reputation: 21

Limiting products that can be bought/ added to cart in Magento

So our store basically sells 6month and annual subscriptions to our businesses website. I was wondering if there was a way to make it so that they can only add one subscription (product) to the cart, not multiples, so customers dont make the mistake of buying double subscriptions?

Upvotes: 2

Views: 2749

Answers (1)

MagePal Extensions
MagePal Extensions

Reputation: 17656

To limit only one item per order

Create a custom module with a observer to disallow adding items if the cart already has quantity (see getItemsQty()). You should also be aware of updateItem() which could be used to change the quantity of items in one's cart

checkout_cart_update_items_after
checkout_cart_product_add_after
checkout_cart_add_product_complete
checkout_cart_update_item_complete
checkout_cart_save_before
checkout_cart_save_after

See - Magento - Adding multiple products to cart programatically

To limit one of each product per order

You can limit the maximum quantity of a product that can be added to your shopping cart by editing the value on the Inventory tab when in product admin.

See Magento: limit product max quantity to 1 per order. quantity 2 = 2 orders

Upvotes: 1

Related Questions