I need a module that when you add product to cart check two conditions and if they are correct will change the price for the product in the basket.
I need do something like this:
– when product is added to the cart – get Qty and custom_attribute
of product
– if qty<0 and cutom_attribute
value for product is >0 change of product price in cart (the changed price should be use in transactional emails, order view, on the invoice etc.)
I try use checkout_product_add_after
, but I cannot get product attribute and check condition. How to get custom product attribute in this event?
Maybe should I use another event?
Best Answer
Try adding an observer for event event
'sales_quote_add_item'
:In your observer :
See https://stackoverflow.com/questions/9721583/changing-the-price-in-quote-while-adding-product-to-cart-magento