diff --git a/classes/tax/TaxRulesGroup.php b/classes/tax/TaxRulesGroup.php index 1ef0dac0f..ea597bab7 100644 --- a/classes/tax/TaxRulesGroup.php +++ b/classes/tax/TaxRulesGroup.php @@ -53,13 +53,22 @@ class TaxRulesGroupCore extends ObjectModel protected static $_taxes = array(); - public static function getTaxRulesGroups($only_active = true) + public static function getTaxRulesGroups($only_active = true, $multiShop = false) { - return Db::getInstance()->executeS(' - SELECT * - FROM `'._DB_PREFIX_.'tax_rules_group` g' - .($only_active ? ' WHERE g.`active` = 1' : '').' - ORDER BY name ASC'); + if ((bool)$multiShop) { + return Db::getInstance()->executeS(' + SELECT * + FROM `'._DB_PREFIX_.'tax_rules_group` g' + .Shop::addSqlAssociation('tax_rules_group', 'g') + .($only_active ? ' WHERE g.`active` = 1' : '').' + ORDER BY name ASC'); + } else { + return Db::getInstance()->executeS(' + SELECT * + FROM `'._DB_PREFIX_.'tax_rules_group` g' + .($only_active ? ' WHERE g.`active` = 1' : '').' + ORDER BY name ASC'); + } } /** diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 7438eda6f..003226a23 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3001,7 +3001,7 @@ class AdminProductsControllerCore extends AdminController $data->assign(array( 'link' => $this->context->link, 'currency' => $currency = $this->context->currency, - 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true), + 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true, true), 'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id), 'ecotaxTaxRate' => Tax::getProductEcotaxRate(), 'tax_exclude_taxe_option' => Tax::excludeTaxeOption(),