Jump to content

Product Price Smarty Variable ?


Recommended Posts

This is not a module. Is an Solution to insert Code in footer.tpl

 

<script type="text/javascript">

var google_tag_params = {

ecomm_prodid: '{$product->id|intval}',

ecomm_pagetype: 'product',

ecomm_totalvalue: '{$product->price}',

};

</script>

<script type="text/javascript">

/* <![CDATA[ */

var google_conversion_id = 869********;

var google_custom_params = window.google_tag_params;

var google_remarketing_only = true;

/* ]]> */

</script>

<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">

</script>

<noscript>

<div style="display:inline;">

<img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/869162052/?guid=ON&script=0"/>

</div>

</noscript>

and what i need is the Price Variable

 

ecomm_totalvalue: '{$product->price}',


Malcom

Link to comment
Share on other sites

Then you do not need smarty; you can use javascript and access the value with:

google_tag_params.ecomm_totalvalue

For example:

<script type="text/javascript">

var google_tag_params = {

ecomm_prodid: '{$product->id|intval}',

ecomm_pagetype: 'product',

ecomm_totalvalue: '{$product->price}',

};

document.getElementById("google_placeholder").innerHTML = google_tag_params.ecomm_totalvalue;
</script>

<span id="google_placeholder"><!-- The product value should appear here --></span>
Edited by saverio.cannilla (see edit history)
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...