sebasimone Posted February 23, 2018 Share Posted February 23, 2018 Hi, I wanted to report an issue with the latest update of prestashop. I had implemented the code to pass on the data to the template file in OrderConfirmationController.php as this: public function initContent() { parent::initContent(); $this->context->smarty->assign(array( 'is_guest' => $this->context->customer->is_guest, 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn() )); if ($this->context->customer->is_guest) { $this->context->smarty->assign(array( 'id_order' => $this->id_order, 'reference_order' => $this->reference, 'id_order_formatted' => sprintf('#%06d', $this->id_order), 'email' => $this->context->customer->email )); /* If guest we clear the cookie for security reason */ $this->context->customer->mylogout(); } /* GOOGLE TAG MANAGER – TRANSACCIONES */ $order = new Order($this->id_order); $cart = new Cart($order->id_cart); $productos = $cart->getProducts(); $this->context->smarty->assign(array( ‘id_pedido’=> $this->id_order, ‘total_a_pagar’=> $order->total_paid_tax_incl, ‘gastos_envio’=> $order->total_shipping_tax_excl, ‘impuestos’=> ($order->carrier_tax_rate/100) + 1, ‘productos’ => $productos )); /* GOOGLE TAG MANAGER – TRANSACCIONES */ $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); } but the GTM part is not executed when the order confirmation page is loaded. Debugger directly shows that no GTM container is loaded. Is it something with the header or the function is not working right? Thanks Link to comment Share on other sites More sharing options...
sebasimone Posted February 24, 2018 Author Share Posted February 24, 2018 I found out the problem: The code at http://www.initcoms.com/blog/como-utilizar-google-tag-manager-en-prestashop/ is right but the quotes need to be code quotes. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now