Return to Snippet

Revision: 45185
at April 27, 2011 02:00 by nico65


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

Initial URL
http://xhtmlandcsshelp.blogspot.com/2010/10/how-to-get-special-price-in-magento.html

Initial Description
not fully tested maybe must be like specialprice in this excample

Initial Title
magento echo all prices

Initial Tags
magento

Initial Language
PHP