Changing product price in Shopware 6 dynamically

0

I would like to change the price of a product based on the customer’s selection. For example, I’m trying to build a small PDP widget to make customers able to choose the number of candles on a cake or write text on cakes and update the price accordingly. The docs only cover how to change the price by overwriting the cart’s collector/processor but I don’t want to use this method because of other plugins potentially overwriting the same service. So, is there are any other methods of changing the price of the products by subscribing to an event?

you would need to „overwrite“ (actually decorate) the following class:

  • Shopware\Core\Content\Product\SalesChannel\Price\ProductPriceCalculator