Help With Variables For Pinterest Code

Hi All-

I am trying to get some pinterest tracking code setup and I need some help with some of the variables to put in, and how to put them in. CS-Cart v4.9.1

This code goes into the of every page (I was planning on putting it in the Layouts so it's more easily editable, but when I try putting a variable in it's not translating so I am not sure if it's the location or what I am trying to use). What I need is in the red email address to fill in if the customer is logged into their account or once they enter in an email address at checkout. I tried $user_data.email but that didn't do anything except print that text out. I tried using {literal} around it but that trick didn't work either.

I need what is for ''





And minimally, then I need the variables for these checkout actions too:




But would really love for it to output like this example:


            

Use Google Analytics module as example

common script in the header

design/themes/responsive/templates/addons/google_analytics/hooks/index/head_scripts.post.tpl

order complete script

design/themes/responsive/templates/addons/google_analytics/hooks/checkout/order_confirmation.post.tpl

As for email., what should displayed for anonymous customers?

Also please note that { and } symbols should not be located on one string. In this case you will receive smarty error

So these have to be placed in tpl files and can’t be put in the script area of each page layout?



I think it should just be blank if no email address is available to show.



Thank you for the help so far!!

So these have to be placed in tpl files and can’t be put in the script area of each page layout?

I think it should just be blank if no email address is available to show.

Thank you for the help so far!!

Yes, you cannot use smarty variables in layout fields

I just took a look at the order_confirmation.post.tpl file in the Google Analytics addon and I see alot of the variables used look like this with ga in front:

{$ga_order_info.order_id}

Is it okay to use that when it's not inside the GA addon folder?

Any tips for the email address on the main code?

Try to use $order_info. E.g.

{$order_info.order_id}

As for email, try to use

{$user_info.email|default:''}

(!) Not tested