// Autoassignation of the cart rule when log out

This commit is contained in:
dMetzger
2012-05-22 10:20:36 +00:00
parent d6507099d4
commit beb198b3d5
2 changed files with 5 additions and 5 deletions

View File

@@ -177,10 +177,6 @@ class FrontControllerCore extends Controller
{
$this->context->customer->logout();
// Login information have changed, so we check if the cart rules still apply
CartRule::autoRemoveFromCart($this->context);
CartRule::autoAddToCart($this->context);
Tools::redirect(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null);
}
elseif (isset($_GET['mylogout']))
@@ -249,6 +245,10 @@ class FrontControllerCore extends Controller
$cart->id_address_delivery = 0;
$cart->id_address_invoice = 0;
}
// Needed if the merchant want to give a free product to every visitors
$this->context->cart = $cart;
CartRule::autoAddToCart($this->context);
}
$locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8');