Magento – Two Custom Options combined: Tier Price doesn’t work

custom-optionstierprice

I'm setting up products and tier prices in Magento, but I've noticed that a in Simple Product with Custom Options (example: blue t-shirt, red t-shirt), the Tier Price won't work if we combine them to reach the quantity.

Tier Prices seem to work only when the quantity is reached from one product variation, but not a combination of two.

I've read several answers on Stack Overflow and the Magento forums, and they recommend to create configurable products.
However this can be pretty hard if a store has lots of products, or lots of variations.

Do you know some workaround to get the Tier Price apply – with a combination of variations?

Best Answer

The problem here is that Magento treats products with different custom options as different line items in cart. So, the qty for the two variants of custom options never adds up to be able to qualify the quote item for a particular tier of tiered pricing.

Now, making this work would involve custom work. I can give you pointers as to where you can look to make it work in the code.

Checkout Mage_Sales_Model_Quote_Address_Total_Subtotal::collect()

In this method you will need to loop through all the quote items and link the tiered quantity applicable on each of the quote items. So say, you have two variants A and B with quantity 1 and 3. You will loop through the quote items and do something like:

$quoteItemA->setTieredQty(1+3);
$quoteItemB->setTieredQty(1+3); //ofcourse 1 and 3 are dynamic here

Then in Mage_Sales_Model_Quote_Address_Total_Subtotal::_initItem

instead of using: $finalPrice = $product->getFinalPrice($quoteItem->getQty()); //on line 115 use:

$finalPrice = $product->getFinalPrice($quoteItem->getTieredQty());

This involves custom work but the approach I'm listing should work with some on the fly adjustments as you work through it.