From 4b2ca3193d708c90fcc1cd9657da529809bc6e17 Mon Sep 17 00:00:00 2001 From: vChabot Date: Thu, 3 Nov 2011 17:16:28 +0000 Subject: [PATCH] [*] FO : when an user is created in one step account creation, he is redirected to the cart if the cart is not empty, or in the my-account page if not. --- controllers/front/AuthController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index 5f34001d8..27d4f840c 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -369,7 +369,12 @@ class AuthControllerCore extends FrontController ); die(Tools::jsonEncode($return)); } - Tools::redirect('index.php?controller=address'); + // redirection: if cart is not empty : redirection to the cart + if (count($this->context->cart->getProducts(true)) > 0) + Tools::redirect('index.php?controller=order'); + // else : redirection to the account + else + Tools::redirect('index.php?controller=my-account'); } }