Home » Magento

Magento: How to get actual price and special price of a product?

12 December 2011 Share/Bookmark

Here is a quick and useful code on getting actual price and special price of any product in Magento. The actual price is the real price assigned to the product and special price is the price after any discount is applied to the product.

Loading Product

$_productId = 52;
$_product = Mage::getModel('catalog/product')->load($_productId);

Get Actual Price

// without currency sign
$_actualPrice = $_product->getPrice();

// with currency sign
$_formattedActualPrice = Mage::helper('core')->currency($_product->getPrice(),true,false);

Get Special Price

// without currency sign
$_specialPrice = $_product->getFinalPrice();

// with currency sign
$_formattedSpecialPrice = Mage::helper('core')->currency($_product->getFinalPrice(),true,false);

Hope it helps. Thanks.

From Mukesh Chapagain's Blog, post Magento: How to get actual price and special price of a product?

email

php magento mukesh chapagain

Get New Post by Email
RSS Feed Subscribe RSS Feed
  • Maurice Naragon

    My site used to display “Regular Price:” – with overstrike, and then “Special Price:” on each product page and listing page. Now, it just shows the price, and I can’t figure out what setting I changed to make this come back. I want to show the regular price and then the discounted price for every item on each screen. Any ideas how I turn this back on?

  • spiralclick

    Quite late but you can achieve it by using if( $_product->getFinalPrice()!=$_product->getPrice()){ show the both prices } else show only the get price…

    thanks