Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -34,6 +34,7 @@ class BlockWishListMyWishListModuleFrontController extends ModuleFrontController
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->context = Context::getContext();
|
$this->context = Context::getContext();
|
||||||
|
$this->ssl = true;
|
||||||
|
|
||||||
include_once($this->module->getLocalPath().'WishList.php');
|
include_once($this->module->getLocalPath().'WishList.php');
|
||||||
}
|
}
|
||||||
@@ -65,10 +66,9 @@ class BlockWishListMyWishListModuleFrontController extends ModuleFrontController
|
|||||||
$id_wishlist = Tools::getValue('id_wishlist');
|
$id_wishlist = Tools::getValue('id_wishlist');
|
||||||
if (Tools::isSubmit('submitWishlist'))
|
if (Tools::isSubmit('submitWishlist'))
|
||||||
{
|
{
|
||||||
if (Configuration::get('PS_TOKEN_ACTIVATED') == 1 AND
|
if (Configuration::get('PS_TOKEN_ACTIVATED') == 1 && strcmp(Tools::getToken(), Tools::getValue('token')))
|
||||||
strcmp(Tools::getToken(), Tools::getValue('token')))
|
|
||||||
$errors[] = $this->module->l('Invalid token', 'mywishlist');
|
$errors[] = $this->module->l('Invalid token', 'mywishlist');
|
||||||
if (!sizeof($errors))
|
if (!count($errors))
|
||||||
{
|
{
|
||||||
$name = Tools::getValue('name');
|
$name = Tools::getValue('name');
|
||||||
if (empty($name))
|
if (empty($name))
|
||||||
@@ -76,7 +76,7 @@ class BlockWishListMyWishListModuleFrontController extends ModuleFrontController
|
|||||||
if (WishList::isExistsByNameForUser($name))
|
if (WishList::isExistsByNameForUser($name))
|
||||||
$errors[] = $this->module->l('This name is already used by another list.', 'mywishlist');
|
$errors[] = $this->module->l('This name is already used by another list.', 'mywishlist');
|
||||||
|
|
||||||
if(!sizeof($errors))
|
if (!count($errors))
|
||||||
{
|
{
|
||||||
$wishlist = new WishList();
|
$wishlist = new WishList();
|
||||||
$wishlist->id_shop = $this->context->shop->id;
|
$wishlist->id_shop = $this->context->shop->id;
|
||||||
@@ -96,17 +96,17 @@ class BlockWishListMyWishListModuleFrontController extends ModuleFrontController
|
|||||||
'{message}' => Tools::getProtocol().htmlentities($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/blockwishlist/view.php?token='.$wishlist->token),
|
'{message}' => Tools::getProtocol().htmlentities($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/blockwishlist/view.php?token='.$wishlist->token),
|
||||||
$this->context->customer->email,
|
$this->context->customer->email,
|
||||||
$this->context->customer->firstname.' '.$this->context->customer->lastname,
|
$this->context->customer->firstname.' '.$this->context->customer->lastname,
|
||||||
NULL,
|
null,
|
||||||
strval(Configuration::get('PS_SHOP_NAME')),
|
strval(Configuration::get('PS_SHOP_NAME')),
|
||||||
NULL,
|
null,
|
||||||
NULL,
|
null,
|
||||||
$this->module->getLocalPath().'mails/');
|
$this->module->getLocalPath().'mails/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($add)
|
else if ($add)
|
||||||
WishList::addCardToWishlist($this->context->customer->id, Tools::getValue('id_wishlist'), $this->context->language->id);
|
WishList::addCardToWishlist($this->context->customer->id, Tools::getValue('id_wishlist'), $this->context->language->id);
|
||||||
else if ($delete AND empty($id_wishlist) === false)
|
elseif ($delete && empty($id_wishlist) === false)
|
||||||
{
|
{
|
||||||
$wishlist = new WishList((int)($id_wishlist));
|
$wishlist = new WishList((int)($id_wishlist));
|
||||||
if (Validate::isLoadedObject($wishlist))
|
if (Validate::isLoadedObject($wishlist))
|
||||||
|
|||||||
Reference in New Issue
Block a user