cookies in smarty tpl(probably syntax errors) -


i got code:

...  {assign var="name" value="some_value"}  {if $smarty.cookies.$name eq 'joc' }      {assign var="test" value="`$product.total - 20`"}     {assign var="test2" value="`$product.total_wt - 20`"}     {assign var="var2" value="$smarty.cookies.$name"}  {else}      {assign var="test" value="`$product.total`"}     {assign var="test2" value="`$product.total_wt`"} {/if}  ... 

please me fix errors , make code work. i'm newbie smarty syntax. var2 empty, "if" condition return false

try adding <pre>{$smarty.cookies|@print_r}</pre> template. debug why if condition not being met. may not have set cookie correctly in first place.

alternatively try http://www.smarty.net/docsv2/en/chapter.debugging.console.tpl investigate smarty variables state.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -