// Context part 31
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8087 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -32,7 +32,7 @@ if (!$id_product = (int)(Tools::getValue('id_product')))
|
||||
die ('0');
|
||||
$id_product_attribute = (int)(Tools::getValue('id_product_attribute'));
|
||||
|
||||
if (!$cookie->isLogged())
|
||||
if (!Context::getContext()->customer->isLogged())
|
||||
{
|
||||
$customer_email = trim(Tools::getValue('customer_email'));
|
||||
if (empty($customer_email) OR !Validate::isEmail($customer_email))
|
||||
@@ -53,7 +53,7 @@ if (!$cookie->isLogged())
|
||||
}
|
||||
else
|
||||
{
|
||||
$id_customer = (int)($cookie->id_customer);
|
||||
$id_customer = (int)Context::getContext()->customer->id;
|
||||
$customer_email = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@ include(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
include(dirname(__FILE__).'/../../init.php');
|
||||
include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php');
|
||||
|
||||
if (!$cookie->isLogged())
|
||||
if (!Context::getContext()->customer->isLogged())
|
||||
die('0');
|
||||
|
||||
$id_customer = (int)($cookie->id_customer);
|
||||
$id_customer = (int)(Context::getContext()->customer->id);
|
||||
if (!$id_product = (int)(Tools::getValue('id_product')))
|
||||
die ('0');
|
||||
$id_product_attribute = (int)(Tools::getValue('id_product_attribute'));
|
||||
|
||||
@@ -258,7 +258,7 @@ class MailAlerts extends Module
|
||||
$id_product = (int)($params['product']->id);
|
||||
$id_product_attribute = 0;
|
||||
|
||||
if (!$this->context->cookie->isLogged())
|
||||
if (!$this->context->customer->isLogged())
|
||||
$this->context->smarty->assign('email', 1);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -34,24 +34,24 @@ include_once(dirname(__FILE__).'/mailalerts.php');
|
||||
|
||||
$errors = array();
|
||||
|
||||
if ($cookie->isLogged())
|
||||
if (Context::getContext()->customer->isLogged())
|
||||
{
|
||||
if (Tools::getValue('action') == 'delete')
|
||||
{
|
||||
$id_customer = (int)($cookie->id_customer);
|
||||
$id_customer = (int)(Context::getContext()->customer->id);
|
||||
if (!$id_product = (int)(Tools::getValue('id_product')))
|
||||
$errors[] = Tools::displayError('You must have a product to delete an alert.');
|
||||
$id_product_attribute = (int)(Tools::getValue('id_product_attribute'));
|
||||
$customer = new Customer((int)($id_customer));
|
||||
MailAlerts::deleteAlert((int)($id_customer), 0, (int)($id_product), (int)($id_product_attribute));
|
||||
}
|
||||
$smarty->assign('alerts', MailAlerts::getProductsAlerts((int)($cookie->id_customer), (int)($cookie->id_lang)));
|
||||
$smarty->assign('alerts', MailAlerts::getProductsAlerts(Context::getContext()->customer->id, (int)Context::getContext()->language->id));
|
||||
}
|
||||
else
|
||||
$errors[] = Tools::displayError('You must be logged in to manage your alerts.');
|
||||
|
||||
$smarty->assign(array(
|
||||
'id_customer' => (int)($cookie->id_customer),
|
||||
'id_customer' => (int)(Context::getContext()->customer->id),
|
||||
'errors' => $errors
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user