Jump to content

[SOLVED] ERROR message when choosing a product


Recommended Posts

Everytime I click on a product I get this error message:

Fatal error: Smarty error: [in /customers/if-fashion.com/if-fashion.com/httpd.www/themes/prestashop/product.tpl line 271]: syntax error: unrecognized tag: *quantity > 1 (Smarty_Compiler.class.php, line 446) in /customers/if-fashion.com/if-fashion.com/httpd.www/tools/smarty/Smarty.class.php on line 1095



Please help me solve this problem.

Thank you in advance.

Link to comment
Share on other sites

You have an opening tag {* without a closing tag *} on line 271 of themes/prestashop/product.tpl:

{if $product->quantity|intval > 0}{l s='Yes'}{else}{l s='No'}{/if}{*quantity > 1} style="display:none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}



If you remove the {* or add a *} the error message should disappear.

Link to comment
Share on other sites

->available_now}{/if}



           <!-- number of item in stock -->

quantity == 0} style="display:none;"{/if}>
{if $product->quantity|intval > 0}{l s='Yes'}{else}{l s='No'}{/if}{*quantity > 1} style="display:none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}
quantity == 1} style="display:none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}



It looks like this. What exactly should I remove? I dont really understand.

Link to comment
Share on other sites

Try changing it to:

<!-- number of item in stock -->

quantity == 0} style="display:none;"{/if}>
{if $product->quantity|intval > 0}{l s='Yes'}{else}{l s='No'}{/if}quantity > 1} style="display:none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}
quantity == 1} style="display:none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}

Link to comment
Share on other sites

Maybe it has something to do when I tried to change how the "in stock status" would look like.

Now it looks strange since english and swedish is mixed together. It says "Yes i lager" ("i lager" is swedish for IN STOCK):

Ho do I correct this? It would be enough if it said "i lager"(in stock) or "tillgänglig"(available)

29398_mlkWVIDSS3prO86yFD8g_t

Link to comment
Share on other sites

In that case, try:

<!-- number of item in stock -->

quantity == 0} style="display:none;"{/if}>
  {*{if $product->quantity|intval > 0}{l s='Yes'}{else}{l s='No'}{/if}*}quantity > 1} style="display:none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}
quantity == 1} style="display:none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}

Link to comment
Share on other sites

<!-- number of item in stock -->

quantity == 0} style="display:none;"{/if}>
  {*{if $product->quantity|intval > 0}{l s='Yes'}{else}{l s='No'}{/if}quantity > 1} style="display:none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}*}
quantity == 1} style="display:none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}

Link to comment
Share on other sites

My mistake, I forgot to remove that one. I've updated the file in my previous post. Please re-download the file and try again. For some reason, when I tell Dreamweaver to save a file as "product.tpl", it saves it as "product.php" instead. That kind of stupid. I've renamed the file this time so it is product.tpl like expected.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...