Magento – Set Discount Price on Product detail page

priceproduct

I am developing a module where I need to set discounted price for a product if applicable. Admin will set a discount percent from backedn for a product and based on that the product price will be calculated.

For ex:

Product Price = 299
Discount Percent = 20%
Discounted Price = 239.20

So the price for that product will be 239.20. I have displayed the discounted price successfully on listing page and the file changes is

catalog/product/list.phtml

But now I also need to change the price on product detail page. The file being used to display the price is

catalog/product/price.phtml

I do not want to change the .phtml file as it has number of conditions for price display.

enter image description here

What is the best method to set the discounted price on product detail page ?

I hope my question is clear.

Please Help.

Thanks

Best Answer

Magento has the ability to display the special price when it is set on a product:

enter image description here

This is styled in the Magento frontend with the markup

<p class="special-price">
    <span class="price-label">Special Price</span>
    <span class="price" id="product-price-423">$224.00</span>
</p>

So using the following CSS should allow you to style it how you see fit:

.special-price .price { 
   /* your rules here */
}

enter image description here