Jump to content

Impossible to create cookie in OrderController


Serial

Recommended Posts

Hi,

 

I want to create cookie in OrderController.php.

It doesn't work. I haven't a cookie in my web browser.

 

This is my override of OrderController.php :

public function get_ChoixMagasin()
	{
		$retrait = $this->context->cart->id_carrier;

		if ($retrait == 13) /* Si le client a choisi le retrait en magasin (id : 13) */
		{
			$resultat = Tools::getValue('choix_magasin');
			$this->context->cookie->__set('choix_magasin', $resultat);
		}
		else /* Sinon on met la variable a 0 */
		{
			$resultat=0;
			$this->context->cookie->__set('choix_magasin', $resultat);
		}
	}

And before set template order-payment.tpl in OrderController.php :

$this->get_ChoixMagasin();
$this->setTemplate(_PS_THEME_DIR_.'order-payment.tpl');
Edited by Serial (see edit history)
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...