From 907d81c32ed3409e997131d6c5042fc5ea16ce2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 22 Aug 2013 10:53:50 +0200 Subject: [PATCH] // duplication of tax_rules_group on adminproducts with multishop --- classes/tax/TaxRulesGroup.php | 15 ++++----------- controllers/admin/AdminProductsController.php | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/classes/tax/TaxRulesGroup.php b/classes/tax/TaxRulesGroup.php index ea597bab7..469b6c641 100644 --- a/classes/tax/TaxRulesGroup.php +++ b/classes/tax/TaxRulesGroup.php @@ -53,22 +53,15 @@ class TaxRulesGroupCore extends ObjectModel protected static $_taxes = array(); - public static function getTaxRulesGroups($only_active = true, $multiShop = false) + public static function getTaxRulesGroups($only_active = true) { - if ((bool)$multiShop) { - return Db::getInstance()->executeS(' - SELECT * + return Db::getInstance()->executeS(' + SELECT DISTINCT g.id_tax_rules_group, g.name, g.active 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 0f3a5216c..2fe0243a7 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2993,7 +2993,7 @@ class AdminProductsControllerCore extends AdminController $data->assign(array( 'link' => $this->context->link, 'currency' => $currency = $this->context->currency, - 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true, true), + 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true), 'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id), 'ecotaxTaxRate' => Tax::getProductEcotaxRate(), 'tax_exclude_taxe_option' => Tax::excludeTaxeOption(),