1

I’m kind of new with magento and I'm making an up-sell for some of my products, and they are showing at the end of the page, but they are without the price, and I want to know how can I make magento to show the prices of the up-sells products that are linked, also if there’s a possibility to show the description of the products too that will be great.

Thanks in advantage

1
  • 3
    1. I understand nothing, maybe add a few screenshots to explain, 2. UPDATE. Magento 1.5 is a big security problem! Commented Aug 26, 2013 at 22:04

2 Answers 2

1

for up-sell product description you can get product id from $_link object

and you want product description so you can get from

$test=Mage::getModel('catalog/product')->load($_link->getId())

and you can get description from $test

$test->getDescription()

and you can get price from $_link object

it may help you

5
  • Word of caution: I would advise against reloading the product model in this scope as it loads the entire product model... May negatively impact performance.
    – philwinkle
    Commented Aug 27, 2013 at 5:01
  • 1
    Besides you shouldn't load a model in a view template file anyhow.... It's against best practice. Cheers.
    – philwinkle
    Commented Aug 27, 2013 at 5:01
  • without reloading product object how we can achieve that?
    – Keyur Shah
    Commented Aug 27, 2013 at 5:05
  • because in $_link object you can get short description not description
    – Keyur Shah
    Commented Aug 27, 2013 at 5:05
  • Well there are a few ways. Link is from a collection and assigned in a loop. Rewrite the collection that link comes from and use addAttributeToSelect('description'). Another way would be to call getResource()->getBackend()and load the description into the currently loaded model.
    – philwinkle
    Commented Aug 27, 2013 at 5:22
0

look into the file yourtemplate/catalog/product/list/upsell.phtml you will find code for displaying price.

The code to display price of upsell product is

<?php echo $this->getPriceHtml($_link, true, '-upsell') ?

Insert the code in upsell.phtml and you will see the price of your upsells product

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.