Magento – Tier Prices with different product options

magento2producttiered-pricingtierprice

We're implementing tier prices in our webshop. We have a simple product with one customizable option 'flavor'. This dropdown has two options: strawberry and banana.

We've added tier prices for this product if you buy 3 or more the price will be € 12,50 instead of € 15,-.

Now, when a customer adds 2 strawberries and 1 banana, the tier price is not applied. It's the same product, so why are we're facing this issue? Is there a known fix or workaround for this issue?

Update:

Special Price settings:
https://www.dropbox.com/s/24c2r62j88ow2lf/Schermafbeelding%202017-11-07%20om%2012.35.40.png?dl=0

Customizable option:
https://www.dropbox.com/s/gbkf1pcnptfapzz/Schermafbeelding%202017-11-07%20om%2012.36.08.png?dl=0

Best Answer

It is not the same product. In Magento 2 there are different types of products:

  1. Simple
  2. Configurable
  3. Bundle
  4. Virtual
  5. Grouped
  6. Downloadable
  7. Gift

Your case is connected with Simple and Configurable products. Let me elaborate on why your assumption "it is the same product" is wrong.

The basic product in Magento is a Simple Product. This is a real entity that can be treated separately from any other products and can have, among the others, private tier prices.

On the other hand, we have got configurable products. This is nothing like a simple product. You can't, for example, buy the configurable product itself, actually, you always buy a simple product with a particular variation of attributes like color - red, size - XL; color - red, size - L.. and so on.

The configurable product can have its own general attributes like description but the essence is that you have to connect at least one simple product with some variation of attributes to make the configurable product available and finally you always put into a cart item related to this particular simple product with chosen attributes variation.

Therefore, as you maybe have noticed, there is no advanced price tab in configurable product settings! Even More, if you put in a cart 2 yellow products and 1 red you cannot say that you have 3 examples of the same item, you have 2 items related to simple product A (yellow) and 1 item related to simple product B (red).

Your assumption that you have 3 of the same items is wrong and therefore expectations fail. Those items are concerning configurable products but are distinct. And it is not an issue regarding the logic. It can be an issue concerning your expectations.

As a solution, I recommend creating custom select attribute rather than a custom option and cart rule which say: if in the cart there are 3 >= products with attribute <your_attribute> then add a discount for these items <your_discount>

If anything is unclear please ask, I will try to elaborate it in more detail.

Update

To be more strict - tier prices (as all prices) are item based not product based. It means that price applies to an item in a cart, not a product that is a generic type. So even though you have the same product in the cart (all data are related to the same entity_id) you have distinct items in the cart. That is why I suggest using cart price rules. It is the only way to achieve your goal without customizing code.

If you want to customize the code I would override Catalog\Pricing\Price\TierPrice class, maybe canApplyTierPrice method

Related Topic