// fixed #PSCFV-2987
This commit is contained in:
1 parent
133f9102ac
commit
7b558bb161
1 file changed
+14
-1
@@ -225,8 +225,21 @@ class AdminShopControllerCore extends AdminController
|
|||||||
$this->errors[] = Tools::displayError('You cannot disable the last shop.');
|
$this->errors[] = Tools::displayError('You cannot disable the last shop.');
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if ($this->errors)
|
if (Tools::isSubmit('submitAddshopAndStay') || Tools::isSubmit('submitAddshop'))
|
||||||
|
{
|
||||||
|
$same_name = Db::getInstance()->getValue('
|
||||||
|
SELECT id_shop
|
||||||
|
FROM '._DB_PREFIX_.'shop
|
||||||
|
WHERE name = "'.pSQL(Tools::getValue('name')).'"
|
||||||
|
AND id_shop_group = '.(int)Tools::getValue('id_shop_group').'
|
||||||
|
'.(Tools::getValue('id_shop') ? 'AND id_shop != '.(int)Tools::getValue('id_shop') : ''));
|
||||||
|
if ($same_name)
|
||||||
|
$this->errors[] = Tools::displayError('You cannot have 2 shops with the same name in the same group');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($this->errors))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$result = parent::postProcess();
|
$result = parent::postProcess();
|
||||||
|
|
||||||
if ($this->redirect_after)
|
if ($this->redirect_after)
|
||||||
|
|||||||
Reference in new issue
Block a user