Jump to content

Edit Orderconfirmationcontroller.php To Output A Var To Order-Confirmation.tpl


Recommended Posts

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

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