Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

if/else display question
 
kramusica
Member
 
Total Posts:  55
Joined:  2008-07-16
 

I have a special field in the cart displaying the full price:
$price = Mage::getModel(’catalog/product’)->load($this->getProduct()->getId())->getData(’price’)

Some of my products have special prices. If so, I would like to see the special price displayed. Is there an else/if, or similar, command I can use to achieve this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

where do you display this price? in cart or catalog?

cheers

Stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
kramusica
Member
 
Total Posts:  55
Joined:  2008-07-16
 

Hi Stefan,

In the cart. I added an additional field with the full price (I’m selling tours and let people pay a deposit price). Some trips have a special price and I would like to have those displayed in the cart.

I know it must be a simple php programming thing but I’m not familiar with php.

It should be someting like this (I think):
if [special-price] is not available
then show $price = Mage::getModel(’catalog/product’)->load($this->getProduct()->getId())->getData(’price’)

Image Attachments
magento-cart.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top