cyrusvsdarius Posted September 5, 2010 Share Posted September 5, 2010 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 1095Please help me solve this problem.Thank you in advance. Link to comment Share on other sites More sharing options...
rocky Posted September 5, 2010 Share Posted September 5, 2010 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 More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 ->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 More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 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 More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 It worked, thank you so much.But I have no idea what I actually removed, first you said that I had to remove the {* or add a *} . But I didnt find it anywhere, anyways I´m happy the problem is solved Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 My code above simply removed {* from: {* Link to comment Share on other sites More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 Another question, I didnt have this problem a couple of days ago. What can have caused this? Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 It looks like someone tried to comment out part of the code in product.tpl, but didn't do it properly. Link to comment Share on other sites More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 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) Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 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 More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 Is it possible to remove it all? (that I marked in the picture) Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 <!-- 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 More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 The code you gave me didnt help, it looks the same. It looks like this now (looks kinda unprofessional, (small letter and its not green text) I would prefer to have this sentence removed, is it possible? Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 Comment out line 276 of product.tpl: {* quantity > $last_qties || $product->quantity == 0) || $allow_oosp} style="display:none;"{/if} >{l s='Warning: Last items in stock!'}*} Link to comment Share on other sites More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 What exactly do I need to do? Sorry if I´m slow Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 I've attached a zip of your product.tpl with the "Number of items in stock" and "Warning: Last items in stock" code commented out. Just unzip it and overwrite your product.tpl. product.tpl.zip Link to comment Share on other sites More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 Its a php file, can I overwrite with it? Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 Wrong place. You shouldn't overwrite product.php, but themes/prestashop/product.tpl. Link to comment Share on other sites More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 I erased the content in product.tpl and put the info from the file you attached instead. But it still doesnt work. It has *} extra now. It looks like this: Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 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 More sharing options...
cyrusvsdarius Posted September 6, 2010 Author Share Posted September 6, 2010 Thank you so much! I could never have made it without you Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now