We are having an error on the homepage by

 Notice: Undefined variable: percentage  in /var/www/vhosts/live/kg-electronics/htdocs/app/design/
 frontend/kg/default/template/catalog/product/price.phtml on line 277
  • post the code of price.html by editing your question. – MTM Sep 16 '14 at 17:30

Welcome to Magento.SE!

You need to define the variable before attempting to use it. It seems that somewhere in your price.phtml file you have made a modification to display a $percentage variable and the logic in price.phtml is executing in such a way that it is not initialized before you attempt to use it.

There are two ways to initialize a variable.

  1. Declare it in your code with a default value:

    $percentage = 0;

  2. Declare it in a class as a member variable (it doesn't apply to your current issue).

To resolve this you need to declare it somewhere near the top of price.phtml as shown in example 1 above.


There may be a larger issue here. Magento should not display notices by default. In this case you may have deployed a development version of index.php or you have an environment variable set in your vhost configuration. Please review to make sure that these have been addressed.

| improve this answer | |
  • 1
    The variable Phil is referring to its MAGE_IS_DEVELOPER_MODE. – Melvyn Sep 16 '14 at 17:39

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.