diff --git a/classes/shop/Shop.php b/classes/shop/Shop.php index c3cdb8a32..8940b382f 100644 --- a/classes/shop/Shop.php +++ b/classes/shop/Shop.php @@ -689,12 +689,7 @@ class ShopCore extends ObjectModel if ($alias) $alias .= '.'; - $restriction = ''; - 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); - + $restriction = ' AND '.$alias.'id_shop IN ('.implode(', ', Shop::getContextListShopID($share)).') '; return $restriction; } diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index c8ff9a033..7756ed9bd 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -68,8 +68,11 @@ class AdminAddressesControllerCore extends AdminController { $this->_select = 'cl.`name` as country'; $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.')'; - $this->_where = 'AND a.id_customer != 0'; + 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_.'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(); }