get Special price or Regular Price in magento


<?php
 $product= Mage::getModel('catalog/product')->load(product_id);
 $price = $product->getPrice();
 $webprice = $product->getwebprice();
 $specialprice = $product->getFinalPrice();
 if($specialprice==$price)
 {?>
 <span>$<?php echo number_format($price,2);?></span>
 <?php } else { ?>
 <div>
 <span>Regular Price:</span>
 <span>$ <?php echo number_format($price,2); ?></span>
 </div>
 <div>
 <span>Web Special:</span>
 <span>$ <?php echo number_format($specialprice,2); ?> </span>
 </div>
 <?php } ?>

for more magento tutorial visit: http://blog.free-extension.com/

Advertisements
  1. this help me a lot, thanks!

    • Max
    • August 10th, 2012

    Thank for effort. But i want if a product with specialprice to be echoed with price and specialprice and if there is no specialprice associated to it the price should only echoed. Please help!

    Best Regards

  2. If you wish for to obtain much from this piece of writing then you have to apply such techniques to
    your won web site.

    • Ken Trier
    • January 24th, 2013

    Hi! A lot of store managers now are struggling to find a way to exclude products with special prices from discount programms. I was seaching for a solution and found the extension which has such functionality. http://amasty.com/special-promotions-pro.html
    Recommend to everybody!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: