Jump to content

Valor de compra en el codigo de conversion de adwords


motlos

Recommended Posts

Buenas he insertado el codigo en ordeer-confirmation.tpv, pero no se como asignarle el valore de conversión, que tiene que ser el valor de la compra, alguien sabe como hacerlo. (ver negrita)

 

Gracias!!

 

!-- Google Code for Venta CallVermell Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 880011402;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "YpkECIzvjmgQitHPowM";
var google_conversion_value = $total_price;
var google_conversion_currency = "EUR";
var google_remarketing_only = false;
/* ]]> */
</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="//www.googleadservices.com/pagead/conversion/880011402/?value=$total_price &currency_code=EUR&label=YpkECIzvjmgQitHPowM&guid=ON&script=0"/>
</div>
</noscript>
 

Link to comment
Share on other sites

You can edit the following function to assign the order total to a smarty variable.

 

/controllers/front/OrderConfirmationController.php

 



displayOrderConfirmation()


Add the following code after 


$order = new Order($this->id_order);



$cart = new Cart((int)$this->id_cart);
$order_total = $cart->getOrderTotal();
$this->context->smarty->assign('total_price', $order_tatal);


After that, you can use the smarty variable to fulfill your requirement.

  • Like 1
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...