Jump to content

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template (v1.6.0.9)


Recommended Posts

After trying to extend the length of product names in the file 'themes/default-bootstrap/product-list.tpl' by changing the truncate value, I started getting the error shown below:


Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/home/content/xxxxx/html/joomla/store/themes/default-bootstrap/product-list.tpl" on line 138 "<a class="button ajax_add_to_cart_button btn btn-default" href="../../prestashop/themes/default-bootstrap/{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}">" - Unexpected "&" <-- thrown in /home/content/xxxxx/html/joomla/store/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 138

 

I have replaced the modified file with an original version from my most recent backup (same PS version), but the problem remains. I have deleted all caches and rebuilt database tables, but nothing has worked.

 

What can I do to fix this? The site goes live on Monday!  :wacko:
 
Here is the site: http://lep4u.com/joomla/store/
 
Thanks in advance!

Link to comment
Share on other sites

have you clear your theme cache folder in

          /cache

          /themes/default-bootstrap/cache 

have you made any changes in product-list.tpl  ???

its seems to be smarty parsing error.

Thanks for answering, yes I have deleted cache in the above mentioned folders as well as:

 

/cache/smarty/compile

/cache/smarty/cache

 

I did not delete every sub directory in /cache, just within the subdirectories as I mentioned above. I left the whole directory structure intact, just cleared out all contents except for index.php files.

 

I did initially make changes to product-list.tpl, but have since replaced the file with an unmodified file from the same PS version.

 

Any other ideas?

Link to comment
Share on other sites

Hi lepusa,

 

Can you open your file themes/default-bootstrap/product-list.php and copy the whole like 138 (the one that starts with:

 

<a class="button ajax_add_to_cart_button btn btn-default" ...   )

 

and past it here? Looks like there's something really strange with this line:

 

href="../../prestashop/themes/default-bootstrap/{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}

 

1) The red 'path' code shouldn't be there...

 

2) those extra red { and } WITHIN the blue { } shouldn't be there. Just use $static_token, not {$static_token} etc. when you are already within curly brackets.

 

Change the line into something like this:

 

<a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart', true, NULL, $smarty.capture.default, false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}" data-minimal_quantity="{if isset($product.product_attribute_minimal_quantity) && $product.product_attribute_minimal_quantity > 1}{$product.product_attribute_minimal_quantity|intval}{else}{$product.minimal_quantity|intval}{/if}">

 

 

If this is like this already, then the problem is probably some caching/recompiling problem:

 

Go to Advanced Parameters->Optimization, and (TEMPORARILY!) turn ON force compilation, and turn OFF smarty caching.

 

 

Then reload page.

 

My 2 cents,

pascal

Link to comment
Share on other sites

Hi lepusa,

 

Can you open your file themes/default-bootstrap/product-list.php and copy the whole like 138 (the one that starts with:

 

<a class="button ajax_add_to_cart_button btn btn-default" ...   )

 

and past it here? Looks like there's something really strange with this line:

 

href="../../prestashop/themes/default-bootstrap/{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}

 

1) The red 'path' code shouldn't be there...

 

2) those extra red { and } WITHIN the blue { } shouldn't be there. Just use $static_token, not {$static_token} etc. when you are already within curly brackets.

 

Change the line into something like this:

 

<a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart', true, NULL, $smarty.capture.default, false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}" data-minimal_quantity="{if isset($product.product_attribute_minimal_quantity) && $product.product_attribute_minimal_quantity > 1}{$product.product_attribute_minimal_quantity|intval}{else}{$product.minimal_quantity|intval}{/if}">

 

 

If this is like this already, then the problem is probably some caching/recompiling problem:

 

Go to Advanced Parameters->Optimization, and (TEMPORARILY!) turn ON force compilation, and turn OFF smarty caching.

 

 

Then reload page.

 

My 2 cents,

pascal

 

Dude... THANK YOU!

 

You led me down the right path, and from there I discovered that not only did the red text not belong (though I did end up leaving the red curly brackets), but there was a > character that had been replaced by >, so that what should have read >getPageLink read >getPageLink instead.

 

Fixing those two issues fixed the site.

 

THANKS AGAIN!

Link to comment
Share on other sites

  • 4 months later...

Hi Everybody...

 

Someone can help me ???

 

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/home/courscolnj/www/override/controllers/admin/templates/products/helpers/form/form_after_1610.tpl" on line 42 "<input type="hidden" name="{$identifier|escape:'html':'UTF-8}" id="{$identifier|escape:'html':'UTF-8}{if isset($smarty.capture.identifier_count) && $smarty.capture.identifier_count}_{$smarty.capture.identifier_count|intval}{/if}" value="{$form_id}" />" - Unexpected "html", expected one of: "}" <-- thrown in /home/courscolnj/www/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 8

 

I'm totally lost in this code...

Help...

Link to comment
Share on other sites

  • 5 months later...

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/home/imitalac/public_html/admin388zjweix/themes/default/template/controllers/modules/login_addons.tpl" on line 40 "<a href="{$addons_register_link|escape:'html':'UTF-8'}"><img class="img-responsive center-block" src="themes/default/img/prestashop-addons-logo.png" alt="Logo PrestaShop Addons"/></a>" unknown modifier "escape" <-- thrown in /home/imitalac/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 40

 

Can anyone help because i can't turn on recompile aslo because no acess to admim panel

Link to comment
Share on other sites

  • 2 weeks later...

please help me how to resolve this

 

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/hermes/bosnaweb17a/b2865/ipg.bloodroses000/themes/ap_food/modules/leomanagewidgets/views/widgets/products_owl.tpl" on line 19 "{foreach from=$products item=products name=products}" item variable 'products' may not be the same variable as at 'from' <-- thrown in /hermes/bosnaweb17a/b2865/ipg.bloodroses000/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 19

Edited by bloodroses000 (see edit history)
Link to comment
Share on other sites

Hi Guys,

 

What i did is i installed fresh prestashop store of same version copied the tools/smarty folder to my old website directory and cleared the contents of cache/smarty/compile folder.

It has started working. 

 

It has solved my problem

 

if it helps someone :)

 

Thanks.

how did you do that? does will erase all my customization i did on my store and some data? please help me im just new to this ps

Link to comment
Share on other sites

  • 4 months later...

Hi, I'm getting a similiar problem. A customer has just reported this to me, they used Safari on iPhone. 

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/xxxx/xxxx/xxxx/modules/paypal/views/template/font/order-confirmation-mobile.tpl" on line 64 "<a href="{$link->getPageLink{'history.php',true, NULL, 'step=1&back={$back|escape:'htmlall':'UTF-8'}')}" data-ajax="false">{ls='Back to orders' mod='paypal'}</a>" - Unexpected "htmlall", expected one of: "","",")"<-- thrown in /xxxx/xxxx/xxxx/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 64

I've looked at smart_internal_templatecompilerbase.php line 64 and it contains:

    /**
     * merged templates
     *
     * @var array
     */
    public $merged_templates = array();

I've also checked order-confirmation-mobile.tpl line 64 and it contains:

<li data-theme="b" data-icon="back">
				<a href="{$link->getPageLink('history.php', true, NULL, 'step=1&back={$back|escape:'htmlall':'UTF-8'}')}" data-ajax="false">{l s='Back to orders' mod='paypal'}</a>

			</li>

I did edit a few of the .tpl files a few weeks back to remove the date of birth field on the order form, my post for that: https://www.prestashop.com/forums/topic/542852-how-to-remove-date-of-birth-from-registration/?do=findComment&comment=2366642

 

Any help would be great, Thanks

 

I'm also using the default template with 1.6.1.6

Edited by jkility (see edit history)
Link to comment
Share on other sites

  • 6 months later...

I am getting this one

 

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template carrier.tpl" on line 250 "{/foreach}" unclosed {if} tag <-- thrownn

 

Anyone knows what i can do?

tried the steps above, didnt helped.

Also overwrite the whole smarty file with the files from a new downloaded prestashop installation.

 

named files gives this (screenshot)

post-1334076-0-72529100-1487628073_thumb.png

Edited by loetje88 (see edit history)
Link to comment
Share on other sites

I am getting this one

 

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/home/plotternederland.nl/public_html/plotternederland.nl/themes/ofajio/order-carrier.tpl" on line 250 "{/foreach}" unclosed {if} tag <-- thrown in /home/plotternederland.nl/public_html/plotternederland.nl/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 250

 

Anyone knows what i can do?

tried the steps above, didnt helped.

Also overwrite the whole smarty file with the files from a new downloaded prestashop installation.

 

named files gives this (screenshot)

 

 

 

its seems to be smarty parsing error.

you gave screenshot. thanks for that.

Make sure following thing in that file

 - Each {if} condition brackets

 - Each {foreach} loop brackets start and end loop

 

after changes, do following:

have you clear your theme cache folder in

          /cache

          /themes/ofajio/cache 

Link to comment
Share on other sites

Hi, i got a similar problem also:

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/home/sites/riversoft.com.mk/public_html/admin397ebpwvj/themes/default/template/header.tpl" on line 256 "headers: {"cache-control": "no-cache"}," - Unexpected ": ", expected one of: "}" <-- thrown in /home/sites/riversoft.com.mk/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 256


Anyone had any experience with it?

Thanks in advance.

 

Best, Dejan

Link to comment
Share on other sites

Hi, i got a similar problem also:

 

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/home/sites/riversoft.com.mk/public_html/admin397ebpwvj/themes/default/template/header.tpl" on line 256 "headers: {"cache-control": "no-cache"}," - Unexpected ": ", expected one of: "}" <-- thrown in /home/sites/riversoft.com.mk/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 256

 

 

Anyone had any experience with it?

 

Thanks in advance.

 

Best, Dejan

 

Its smarty error occurred during parsing.

which PS version u r using? 

Although its seems like header file is not properly parsing. try to re-upload fresh header.tpl file only.

  • Like 1
Link to comment
Share on other sites

Its smarty error occurred during parsing.

which PS version u r using? 

Although its seems like header file is not properly parsing. try to re-upload fresh header.tpl file only.

Hey archSandy,

 

I just changed the header.tpl file and it works again. Thank you very much man. God bless you!

 

Best,

Dejan

Link to comment
Share on other sites

  • 2 years later...

Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/home/plazasat/public_html/themes/pf_megashop/footer.tpl" on line 65 "{plugin module='blocknewsletter' hook='footer'}" unknown tag "plugin" <-- thrown in

can anyone help this? i've copy my older site with its themes to difference server, and delete /cache/ and /themes/cache

 

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...