kronoszx
5/9/2018 - 10:34 PM

google tags order conversion

override necesario

<?php
class OrderConfirmationController extends OrderConfirmationControllerCore
{

    /**
     * Assign template vars related to page content
     * @see FrontController::initContent()
     */
    public function initContent()
    {


        global $cookie;
        $cmspage = new CMS(34, intval($cookie->id_lang));
        if (Validate::isLoadedObject($cmspage))
          $this->context->smarty->assign('cmspage', $cmspage->content);

      parent::initContent();
      $order = new Order($this->id_order);
      $customer= new Customer ($order->id_customer);
      $this->context->smarty->assign(array(
          'id_order' => $this->id_order,
          'order' => $order,
          'customer' => $customer,
          'reference_order' => $this->reference,
          'id_order_formatted' => sprintf('#%06d', $this->id_order),
          'total_to_pay' => $order->getOrdersTotalPaid()
      ));
      $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl');
    }

}
<?php
// in /override/controllers/front

class OrderConfirmationController extends OrderConfirmationControllerCore
{
    /**
     * Assign template vars related to page content
     * @see FrontController::initContent()
     */
    public function initContent()
    {
        //// google adwords conversion / dyn remarketing ////
        $order = new Order($this->id_order);
        $currency = new Currency($order->id_currency);
        $this->context->smarty->assign(array(
          'products'=> $order->getProducts(),
          'total_to_pay'=>$order->getOrdersTotalPaid(true),
        'orderCurrency' => $currency->iso_code,
        'id_order' => $this->id_order
        ));
        //// google adwords conversion / dyn remarketing ////
        parent::initContent();
    }

}