Jump to content

GTM stopped Working after 1.6.18


sebasimone

Recommended Posts

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

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...