Search code examples
magento

Apply a discount to all products in Magento


I am new to Magento. I want to provide a 30% discount on all the products. Also want the old price to have a cross sign on the frontend of my website.

Could anyone please help me to perform this task?


Solution

  • Firstly, you have to create a Catalog Price Rule. Go to Promotions/Catalog Price Rule and create a new rule. In "Actions" tab, set Apply by Percentage and set Discount Amount to 30. Set all other fields as required.

    This will apply 30% discount on all the products.

    To get a cross sign on original price and display discounted price, you have to do some edits in price.phtml list.phtml and view.phtml in your theme, i.e

    app/design/PACKAGE/THEME/catalog/product/

    To get original price, call getPrice() on product object. For discounted price, use getFinalPrice()

    In your case, it should be $_product->getPrice() and $_product->getFinalPrice()

    Apply CSS to put a strike mark on original price.