0

I have to set my products price regarding some consumers parameters.

For the product page I use : $_product->setFinalPrice($Price);

I also have to change the price when the product is added to cart. For this I use on checkout_cart_product_add_after event observer

$_item->setCustomPrice($finalCustPrice); 
$_item->setOriginalCustomPrice($finalCustPrice);
$_item->getProduct()->setIsSuperMode(true);
$_item->save();

I would like to be sure that the price change I make is only performed for the current customer session and not for entire site, which would generate conflicts if several customers were "setting" the product prices at the same time…

Thank you for your help

1

The "item" is only used in the quote (cart). This data only belongs to the customers session. But to get sure by yourself just test it with two browsers so that you can simulate two customers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.