I'm trying to display all tier prices on category listing page (catalog/product/list.phtml) but only getting the basic price for a single product.
print_r($_product->getTierPrice());
returns:
Array
(
[0] => Array
(
[price] => 0.5000
[website_price] => 0.5000
[price_qty] => 1
[cust_group] => 32000
)
)
for each product. On the product info page it works w/o problems. Please advise.
ver. 1.5.0.1
UPDATE:
Here is the solution for the problem inspired with the answer below:
$resource = Mage::getSingleton('core/resource');
$query = 'SELECT * FROM ' . $resource->getTableName('catalog/product') . '_tier_price';
$_tier_prices = $resource->getConnection('core_read')->fetchAll($query);
var_dump($_tier_prices);
Magento Open Source includes simple start and end date options in the Advanced Pricing options. Open the product in edit mode. Scroll down to the Price field, click Advanced Pricing, and enter the Special Price amount. ) to choose the Start Date and End Date for the special price promotion.
Definition. Tier price in Magento 2 refers to the ability to set a discount based on the volume of items purchased. After hitting each benchmark (tier), customers will enjoy a new and better price. Something like this: This rule will run on a specific store view, customer group, or shared catalog.
This is another way to get the tier prices
Mage::getResourceModel('catalog/product_attribute_backend_tierprice')
->loadPriceData($product_id,Mage::app()->getWebsite()->getId());
The response is array with prices
[0] => Array
(
[price_id] => 7
[website_id] => 0
[all_groups] => 1
[cust_group] => 0
[price] => 32.0000
[price_qty] => 6.0000
)
[1] => Array
(
[price_id] => 8
[website_id] => 0
[all_groups] => 1
[cust_group] => 0
[price] => 31.0000
[price_qty] => 12.0000
)
If you are looking for a Magento way:
$attribute = $_product->getResource()->getAttribute('tier_price');
if ($attribute) {
$attribute->getBackend()->afterLoad($_product);
$tierPrices = $_product->getTierPrice();
}
From /app/code/core/Mage/Catalog/Model/Product/Type/Price.php
getTierPrice()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With