2

For a product I have a catalog price rule and tier price.

When I add item to cart Magento always takes the least price. Is there any way to set it to take price according to catalog price rule always?

I searched but didn't get a solution for this. Is there any admin settings for this?

1 Answer 1

4

The code that drives the price can be found in Mage_Catalog_Model_Product_Type_Price

public function getFinalPrice($qty=null, $product)
{
    if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) {
        return $product->getCalculatedFinalPrice();
    }

    $finalPrice = $product->getPrice();
    $finalPrice = $this->_applyTierPrice($product, $qty, $finalPrice);
    $finalPrice = $this->_applySpecialPrice($product, $finalPrice);
    $product->setFinalPrice($finalPrice);

    Mage::dispatchEvent('catalog_product_get_final_price', array('product'=>$product, 'qty' => $qty));

    $finalPrice = $product->getData('final_price');
    $finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice);

    return max(0, $finalPrice);
}

In _applyTierPrice

$finalPrice = min($finalPrice, $tierPrice);

and through _applySpecialPrice

$finalPrice     = min($finalPrice, $specialPrice);

There are no options involved and it will return the minimum price.

In my view this also matches the expectation of the customer!

If you do want to change this behaviour you can observe the event catalog_product_get_final_price and use $product->setData('final_price',X.YZ); to the value you want.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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