magento echo all prices


/ Published in: PHP
Save to your folder(s)

not fully tested maybe must be like specialprice in this excample


Copy this code and paste it in your HTML
  1. <?php
  2. $product= Mage::getModel('catalog/product')->load(product_id);
  3. $price = $product->getPrice();
  4. $webprice = $product->getwebprice();
  5. $specialprice = ($_product->getSpecialPrice());
  6. if($specialprice==$price)
  7. {?>
  8. <span class="price">Price $<?php echo number_format($price,2);?></span>
  9. <?php } else { ?>
  10. <div class="regular-price">
  11. <span>Regular Price:</span>
  12. <span class="price">$ <?php echo number_format($price,2); ?></span>
  13. </div>
  14. <div class="special-price">
  15. <span>Web Special:</span>
  16. <span class="price">$ <?php echo number_format($specialprice,2); ?> </span>
  17. </div>
  18. <?php } ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.