0

In my view.phtml i would get only last tier price of my product. For example for a my product i have this prices: 100 ($ 1,20) - 200 ($ 1,10) - 300 ($ 1,00)

I want see in my view.phtml only last tier price -> $ 1,00

I tried with this code: $_product->getTierPrice(1) but show only first tier price in page of product.

How can i do?

2
  • do you want to show tier price at specific location? May 23, 2018 at 13:28
  • Yes, i would show only lowest tier price instead of standard final price
    – Gabriel91
    May 23, 2018 at 13:40

2 Answers 2

0

You can get product tier price using this code.

$product_sku = 'Your_Product_Sku';
$product = Mage::getModel('catalog/product')->loadByAttribute('sku',$product_sku);
var_dump($product->getTierPrice());
2
  • Not work man, show me only an array with all prices and quantity
    – Gabriel91
    May 23, 2018 at 14:17
  • You need to take the value from array which you want to display. May 24, 2018 at 2:59
0

Mage_Catalog_Model_Product->getTierPrice() will return an array, in your case it would return

[100] => 1.2,
[200] => 1.1,
[300] => 1

So just call it and pop the end off the array to get the lowest price? The argument to getTierPrice is not an index into the array, it's the qty you want the price for.

Or use Product->getMinimalPrice() but I can't remember if that needs the price index to be built or not.

-- I meant to add that you can see getMinimalPrice being used in base/default/template/catalog/product/price.phtml

Your Answer

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

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