I am trying to figure out the best way implement a checkbox in Magento admin that will allow for users to select whether to display a special price on the frontend or not.

I understand that this can be set via product attributes but I would like to be able to select which products will have the special price shown or not by ticking a checkbox to "Show special price on frontend"...

So far I have created the attribute show_special_price I now need to add this to an IF condition within the template.

$_specialPriceStoreLabel = Mage::getModel('catalog/product')->loadByAttribute('show_special_price', '1');

but I can't figure out which line since there are many IF conditions in there.

  • 1
    why don't you have that attribute as "yes/no" select type? – Shathish Jan 10 '14 at 5:46
  • @Shathish yes the attribute is yes/no option I just need to find where to add the if condition since price.phtml is 400 lines long! – user1704524 Jan 10 '14 at 8:43
  • simple answer would be find all occurrence of class="special-price" in the file and put all those markups inside your condition. But remember! there's always a better solution ;) – Shathish Jan 10 '14 at 9:56

instead of attribute, create a system configuration of enabled/disabled, follow below link to know how to get started.


and use yes/no option i.e the second one.

  • that's a better !dea, but the user wants to know, where to add the condition – Shathish Jan 10 '14 at 9:50
  • use template path hint to check the location of phtml file for special price – Deepak Mallah Jan 10 '14 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.