// Add a multishop restriction on address in BO #PSTEST-1035
This commit is contained in:
@@ -689,12 +689,7 @@ class ShopCore extends ObjectModel
|
|||||||
if ($alias)
|
if ($alias)
|
||||||
$alias .= '.';
|
$alias .= '.';
|
||||||
|
|
||||||
$restriction = '';
|
$restriction = ' AND '.$alias.'id_shop IN ('.implode(', ', Shop::getContextListShopID($share)).') ';
|
||||||
if (Shop::getContext() != Shop::CONTEXT_ALL)
|
|
||||||
$restriction = ' AND '.$alias.'id_shop IN ('.implode(', ', Shop::getContextListShopID($share)).') ';
|
|
||||||
//else if ($share == Shop::SHARE_STOCK)
|
|
||||||
// $restriction = ' AND '.$alias.'id_shop = '.$this->getID(true);
|
|
||||||
|
|
||||||
return $restriction;
|
return $restriction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,8 +68,11 @@ class AdminAddressesControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
$this->_select = 'cl.`name` as country';
|
$this->_select = 'cl.`name` as country';
|
||||||
$this->_join = '
|
$this->_join = '
|
||||||
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')';
|
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')
|
||||||
$this->_where = 'AND a.id_customer != 0';
|
LEFT JOIN `'._DB_PREFIX_.'customer` c ON a.id_customer = c.id_customer
|
||||||
|
';
|
||||||
|
|
||||||
|
$this->_where = 'AND a.id_customer != 0 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER, 'c');
|
||||||
|
|
||||||
return parent::renderList();
|
return parent::renderList();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user