Skip to content

Magento 2 Bundle Products: Don’t take into consideration special price (discount) of a bundle items (child products)

I created a bundle product using dynamic price. This means Magento will calculate the bundle product price based on the price of each bundle item (child product) the customer selects.
Let say we have:

  • Bundle product with dynamic price. Let’s call it: PRODUCT MAIN
  • This PRODUCT MAIN has Bundled items:
    o Product A, Price: 100 €
    o Product B, Price: 200 €

This means if the costumer selects PRODUCT A the price of the PRODUCT MAIN will be 100 € and if it selects PRODUCT B the price of the PRODUCT MAIN will be 200 €.
So far everything is OK.

Now let’s say we add SPECIAL PRICE to product A: 50 € (50% percent discount).

Now, if the customer chooses PRODUCT A, the price of product bundle PRODUCT MAIN will be 50 € (the special price (discount 50%) of bundled item PRODUCT A is taken into consideration when calculating final price of the bundle product PRODUCT MAIN).

For our business this is a problem, because we DON’T WANT that the special price of the bundle item (child product) is taken into consideration when calculating final price of bundle product PRODUCT MAIN.

So, we need to modify the logic how bundle products final price is calculated.
We need to recalculate programmatically the final price in a way that it removes any existing special prices of every bundle items (child products).

I need some ideas where to start, which files to look at, etc to accomplish this goal? Maybe an observer on catalog_product_get_final_price and then do the logic (how exactly).

Thank you.