Jump to content

Commandes "gratuites" - comment rediriger vers order-confirmation.tpl


Recommended Posts

Bonjour,

 

J'ai un problème avec la redirection des commandes gratuites après validation du panier pour un invité.

Je voudrais suivre ces commandes via google analytics en les redirigeant via order-confirmation.

Pour cela, j'ai voulu changer dans /controllers/front/OrderController.php :

 // Bypass payment step if total is 0
                if (($id_order = $this->_checkFreeOrder()) && $id_order) {
                    if ($this->context->customer->is_guest) {
                        $order = new Order((int)$id_order);
                        $email = $this->context->customer->email;
                        $this->context->customer->mylogout(); // If guest we clear the cookie for security reason
                        Tools::redirect('index.php?controller=guest-tracking&id_order='.urlencode($order->reference).'&email='.urlencode($email));
                    } else {
                        Tools::redirect('index.php?controller=history');
                    }
                }

 

 

Par :

// Bypass payment step if total is 0
				if (($id_order = $this->_checkFreeOrder()) && $id_order)
				{
					if ($this->context->customer->is_guest)
					{
						$order = new Order((int)$id_order);
						$email = $this->context->customer->email;
						$this->context->customer->mylogout(); // If guest we clear the cookie for security reason
						Tools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$cart->id.'&id_module='.(int)$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
					}
					else
						Tools::redirect('index.php?controller=history');
				}

 

Le problème est que je suis toujours redirigé vers guest-tracking.

 

Quelqu'un aurait-il une idée ?

 

Merci

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