Dali
Dali

Reputation: 7882

Magento: Add the same product to cart several times

I try to add product twice (or several times) to cart, with different attributes values.

I have read this post : Magento: add product twice to cart, with different attributes!

but I haven't found a good clear answer there.

I have overriden the controller "app/code/core/Mage/Checkout/controllers/CartController.php" but I don't know what to do after that.

Upvotes: 1

Views: 4171

Answers (4)

Nuno Furtado
Nuno Furtado

Reputation: 4568

Try using custom options, change the option value programmaticly

Upvotes: 0

Raif Atef
Raif Atef

Reputation: 2918

Add the lens eye (left or right) as a custom option to the product in the backend.

Magento uses product custom options as one of the discriminators between shopping cart items when trying to determine whether to add a quantity to an existing cart item or create a new one.

The user can choose LEFT or RIGHT from the frontend and Magento will show it in the cart as 2 separate products, but deduct the stock from the same physical product.

Upvotes: 1

kushal mehta
kushal mehta

Reputation: 54

Go to class Mage_Sales_Model_Quote and search for the method getItemByProduct($product) and make it return false all the time. Be careful, this might interfere with the minimum & maximum allowed in cart for products.

Upvotes: 0

Nasaralla
Nasaralla

Reputation: 1839

The two product pair if you are trying to add should still have some different attribute... if it is lenses or shoes or gloves add an attribute to tell if it is left or right to distinguish... or else the two products you add count as the same product with quantity 2.

Upvotes: 0

Related Questions