Magento 1.7 – How to Get Discounted Price

cart-rulecatalog-price-rulesdiscountmagento-1.7totals

I create a Catalog price rule in admin. Now it's applying in the front-end. But, I want to show actual price in the shopping cart. So I did the below code in abstract.php file. After that I call it in default.phtml. Now I can see the product price are showing like that I want. But now I need to show one line with discounted price before the grand total label.

    public function getPriceWithoutDiscount()
    {/*Edit by Yesh*/
       if ($this->getProductId()) {
             $productID = $this->_getData('product');
             $productID = $this->getProductId();
             $product = Mage::getModel('catalog/product')->load($productID);
             $price = $product->getPrice();
       }
    return $price;
    }

Any suggestions?


Please see my screenshot

enter image description here

Best Answer

If you want the discount to be applied in the totals you should use shopping cart price rules, not catalog price rules. It is possible to specify shopping cart price rules based on the products in the cart and also apply discounts only to certain products.

Then the only problem left is to display original and discounted price on the product detail page which is way easier to solve than what you tried originally (just frontend, no changes in internal price and total calculation)

Related Topic