2

I am trying to edit my view.phtml in my theme to build a tierprice table on my product view page so I am trying to first just list the price tiers but nothing is showing up.

I have found the following code in : /app/design/frontend/base/default/template/bundle/catalog/product/view/tierprices.phtml

<?php
 $_product = $this->getProduct();
 $_tierPrices = $this->getTierPrices();
?>
<?php if (count($_tierPrices) > 0): ?>
 <ul class="tier-prices product-pricing">
 <?php foreach($_tierPrices as $_price): ?>
    <li><?php echo $this->__('Buy %1$s with %2$s discount each', $_price['price_qty'], '<strong class="benefit">'.($_price['price']*1).'%</strong>') ?></li>
<?php endforeach ?>
</ul>
<?php endif;?>

But when I paste it the view.phtml it shows nothing. But it is working at the top of the page next to the add to cart button ( default location ).

Can anyone point me in right direction here or see what I am doing wrong.

  • make sure you have not catalog rules active. – user38644 Apr 14 '16 at 8:36
2

Please add following code in your view.phtml file

<?php echo $this->getTierPriceHtml() ?>
  • Thankyou Jaydip. I have already done this though and it echo's a formatted lines of text like " Buy 6 for £2.65 each and save 8% " but I actually need to to get all the values so I can construct a table – Barry Connolly Jun 9 '15 at 9:49
1

As mentioned by others you need to add <?php echo $this->getTierPriceHtml() ?> This will use tierprices.phtml to create the output. Then you must create /app/design/frontend/[your-package]/[your-theme]/template/catalog/product/view/tierprices.phtml

Keep the first few lines for data retrieval(such as $_tierPrices = $this->getTierPrices();) and then create the table as you wish. It will help to Zend_debug::dump($_tierPrices) to see the data you have available.

0

Please try overriding the following file:

  • /app/design/frontend/base/default/template/catalog/product/view/tierprices.phtml

If you have a theme installed in your magento then look into:

  • /app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/catalog/product/view/tierprices.phtml
0

As per magento sytem has been show at view.phtml using below code.

 <?php echo $this->getTierPriceHtml() ?>

You neeed to check this code exit on your view.phtml If not then need to add thos.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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