|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
proc Smarty n00b
Joined: 29 Dec 2016 Posts: 2
|
Posted: Thu Dec 29, 2016 1:59 pm Post subject: Single quotes doesn't evaluate in google remarketing tag |
|
|
Hello,
I am new to smarty. I have the following remarketing code in smarty for cs cart. I need single quotes for product codes in variable ecomm_prodid. But quotes are displayed as '
I have tried escape, html_entity_decode but do not know what exactly needs to be done
Any help would be appreciated.
{capture name="checkout_order_info"}
{foreach from=$order_info.products item="item" name="products"}
'{$item.product_code}'{if not $smarty.foreach.products.last},{/if}
{/foreach}
{/capture}
{capture name="prodId"}{if $runtime.controller eq 'products'}{$product.product_code}{elseif $runtime.controller eq 'checkout' && $runtime.mode ne 'complete'}[{$smarty.capture.cart_order_info nofilter}]{elseif $runtime.controller eq 'checkout' && $runtime.mode eq 'complete'}[{$smarty.capture.checkout_order_info nofilter}]{/if}{/capture}
var google_tag_params = {
ecomm_prodid: ['KTTY01P5','KTBD01P1','BMC00671'],
ecomm_pagetype: 'cart',
ecomm_totalvalue: 66.00
}; |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Dec 29, 2016 5:42 pm Post subject: |
|
|
It seems you are using default modifier.
Also, I would strongly suggest json_encode instead of that foreach loop. |
|
Back to top |
|
proc Smarty n00b
Joined: 29 Dec 2016 Posts: 2
|
Posted: Fri Dec 30, 2016 4:56 am Post subject: |
|
|
Thanks for the reply. But if you could provide some example it would be very helpful. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|