gnappoman Posted November 27, 2015 Share Posted November 27, 2015 Hello, Prestahop 1.5.6.0 in /override/controllers/front/OrderConfirmationController.php I insert between /* If guest we clear the cookie for security reason */ $this->context->customer->mylogout(); } $order = new Order($this->id_order); $cart = new Cart($order->id_cart); foreach ($cart->getProducts() AS $prodotto){ if ($prodotto->id == 33061 || $prodotto->id == 33062){ $ruzzante = true; } } $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); } then at the end of order-confirmation.tpl I add {if $ruzzante}<script type="text/javascript">window.alert(2);</script>{/if} but it doesn't show What am I doing wrong? Thank you very much indeed, J Link to comment Share on other sites More sharing options...
cristic Posted November 30, 2015 Share Posted November 30, 2015 You need to send ruzzante variatle to Smarty. In your code, you are just setting the php variable to true. Add this line after $ruzzante = true; $this->smarty->assign('ruzzante' => true); 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