4

I am not sure if this is possible but i want to add something to my cart table that checks if a products has a tiered saving (Buy 2 and save £5) and if the customer is not taking advantage of this saving then it tells them so in the cart.

Ideally we would like to have a String saying "Saving available" then when you put your cursor over it it pops up with a box showing the tiered price. I have added a picture to show what i mean. enter image description here

However if that is not possible (the hover) is it possible just to show the saving in the cart under the title enter image description here

I have just tried this:

Add this after $_item = $this->getItem(); inside checkout/cart/item/default.phtml:

$_tierPricing = $this->getLayout()->createBlock(
    'catalog/product_view',
    'product.tierprices',
    array(
        'product_id' => $_item->getProductId()
    )
);
$_tierPricing->setTemplate('catalog/product/view/tierprices.phtml');
And then where you want to put your pricing info:

<?php echo $_tierPricing->getTierPriceHtml();?>

Source:Magento display tiered pricing for each product on cart page

And i can see it is pulling the template in but it is displaying nothing

////////////////UPDATE\\\\\\\\\ It seems to work it the product that is first in the cart has a tiered price but then it displays that tier price on all products??

Thanks

2

Your posted solution just needs a tiny improvement. So here is the full answer:

  1. Copy the template checkout/cart/item/default.phtml to your theme.
  2. Add the following code after the line $_item = $this->getItem();:

    $_tierPricing = $this->getLayout()->createBlock(
        'catalog/product_view',
        'product.tierprices',
        array(
            'product_id' => $_item->getProductId()
        )
    );
    
  3. Add the following code where you want the tier price to be displayed:

    <?php echo $_tierPricing->getTierPriceHtml($_item->getProduct());?>
    

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.