Reputation: 461
Is it possible to add the same product to the basket twice or more times with different prices?
I know how to change the price of product when I add it to the basket using an observer and the event checkout_cart_product_add_after. But right now, when I change the price via the quote item in the observer, all products of this type that are already in the basket get the price of the last item of this type that I added…
Upvotes: 0
Views: 591
Reputation: 15216
When you add the product with the changed price add also this to the item and the product:
$data['c_price'] = 'YOUR CUSTOM PRICE HERE';
$product->addCustomOption('c_price', serialize($data));
$item->addOption($product->getCustomOption('c_price'));
This way the new product shouldn't be merged with the previous one, but if you add the product again with the custom price then it will be merged with the one you previously added with a custom price.
Upvotes: 1