Using 1.11.7 and up-to-date modules
I have this code in a Products Module template:
{cge_have_module m='CGEcommerceBase' assign='tmp'}
{if $tmp}
{ if isset($entry->fields.mto->value) && $entry->fields.mto->value == 'true'}
<p>Note:This item is made to order. Please add requirements in the Order Notes box when checking out.</p>
{else}
<div>
{cgecomm_form_addtocart product=$entry->id}
</div>
{/if}
{/if}
This is rendering an "unexpected closing tag {/if}" syntax error - the last one above.
If I remove it, the page loads but it shows { if isset($entry->fields.mto->value) && $entry->fields.mto->value == 'true'} on the online page above the text "Note:This item is made to order. Please add requirements in the Order Notes box when checking out."
Is this closing tag in the wrong place?
Thanks
[Solved]Products Module: syntax error
[Solved]Products Module: syntax error
Last edited by jasnick on Thu Aug 08, 2013 7:58 am, edited 1 time in total.
Re: Products Module: syntax error
Note the spave just after the { ... Smarty 3 interprets that as {literal} opening tag. Remove the space and it should work.Code: Select all
{ if isset($entry->fields.mto->value) && $entry->fields.mto->value == 'true'}
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Products Module: syntax error
No, remove the space after the {
http://www.smarty.net/v3_overviewIn Smarty 2, you had to escape occurances of {} characters by surrounding them with {literal}{/literal} blocks or replacing them with {ldelim}{rdelim} tags. With Smarty 3, the braces will be ignored so long as they are surrounded by white space.
Re: Products Module: syntax error
Anyway, thanks to you both - I struggle enough with $Smarty without making typos.


