Jump to content

OrderController override issue


Recommended Posts

Hi,

I have written an override for the order controller in Prestashop 1.7.

in the function :

 public function initContent()
 {

…..

 if ($msg !="") {
                        $this->errors[] = $this->trans($msg_restricted_products, array(), 'Shop.Notifications.Error');
                        echo '<script type="text/javascript">alert("' . utf8_encode(html_entity_decode($msg_restricted_products)) . '");</script>';
                       // I need to stop the process and return to cart here

}

 

The echo works but if I add an instruction like redirect to index the echo does not fire.

How can I do a redirection and exit the order ?

 

Thanks for helping.

Jean-Marie
                       

 

Link to comment
Share on other sites

Hi,

I change the echo with :

echo '<script type="text/javascript">document.getElementByName("confirm-addresses").hidden=true;" );</script>';

But this does not work.

How can I disable the order ?

Jean-Marie

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