>> We use to get product price like :
$_product->getPrice();
$_product->getFinalPrice();
Here you can get the catalog rule applied price like:
$store_id = Mage::app()->getStore()->getId();
$discounted_price = Mage::getResourceModel('catalogrule/rule')->getRulePrice(
Mage::app()->getLocale()->storeTimeStamp($store_id),
Mage::app()->getStore($store_id)->getWebsiteId(),
Mage::getSingleton('customer/session')->getCustomerGroupId(),
$_product->getId());
if ($discountedPrice===false) { // if no rule applied for the product
$discountedPrice = $_product->getFinalPrice();
}else{
$discountedPrice = number_format($discountedPrice,2);
}
No comments:
Post a Comment