diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index 27a15f2e9..bf0c54803 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -278,6 +278,9 @@ class AuthControllerCore extends FrontController $this->context->cart->id_address_delivery = Address::getFirstCustomerAddressId((int)($customer->id)); $this->context->cart->id_address_invoice = Address::getFirstCustomerAddressId((int)($customer->id)); $this->context->cart->update(); + // Add customer to the context + $this->context->customer = $customer; + Hook::exec('authentication'); // Login information have changed, so we check if the cart rules still apply @@ -291,8 +294,10 @@ class AuthControllerCore extends FrontController } } } + elog('here???'); if ($this->ajax) { + elog(Tools::getToken(false)); $return = array( 'hasError' => !empty($this->errors), 'errors' => $this->errors, diff --git a/themes/prestashop/js/order-opc.js b/themes/prestashop/js/order-opc.js index fcdaa2aa4..4de6bfab3 100755 --- a/themes/prestashop/js/order-opc.js +++ b/themes/prestashop/js/order-opc.js @@ -272,12 +272,12 @@ function confirmFreeOrder() { var array_split = html.split(':'); if (array_split[0] === 'freeorder') - { - if (isGuest) - document.location.href = guestTrackingUrl+'?id_order='+encodeURIComponent(array_split[1])+'&email='+encodeURIComponent(array_split[2]); - else - document.location.href = historyUrl; - } + { + if (isGuest) + document.location.href = guestTrackingUrl+'?id_order='+encodeURIComponent(array_split[1])+'&email='+encodeURIComponent(array_split[2]); + else + document.location.href = historyUrl; + } }, error: function(XMLHttpRequest, textStatus, errorThrown) {alert("TECHNICAL ERROR: unable to confirm the order \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);} });