// 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:
@@ -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