php - How to prevent adding same product to cart more then one time in magento -
i new in magento development. dont want user add product more once cart.if he/she need change qty of product he/she need change mycart page add cart button allow once add product, after when he/she clicks on add cart button must "it added cart if want change quantity please go mycart".
for example can see www.flipkart.com.
have at:
product -> inventory -> maximum qty allowed in shopping cart
system -> configuration -> inventory -> maximum qty allowed in shopping cart
have @ customize magento using event/observer.
events use, example: checkout_cart_update_items_before
, checkout_cart_product_add_after
also i'd suggest looking atthe: /app/code/core/mage/checkout/model/cart.php
other events might helpful.
in file also, you'll find code like:
$this->getcheckoutsession()->adderror( mage::helper('checkout')->__('some of requested products unavailable.') );
which use displaying the error message customer.
Comments
Post a Comment