From 9eceacf655a39520d2d0a8aaee08cdf0d552de5d Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 3 Jun 2025 17:03:20 +0530 Subject: [PATCH] Fixed: notices occured while creating tax rule group --- classes/tax/TaxRulesGroup.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/classes/tax/TaxRulesGroup.php b/classes/tax/TaxRulesGroup.php index 0f5d3e4f0..fda98ba26 100644 --- a/classes/tax/TaxRulesGroup.php +++ b/classes/tax/TaxRulesGroup.php @@ -117,20 +117,22 @@ class TaxRulesGroupCore extends ObjectModel public function getIdTaxRuleGroupFromHistorizedId($id_tax_rule) { - $params = Db::getInstance()->getRow(' - SELECT id_country, id_state, zipcode_from, zipcode_to, id_tax, behavior - FROM '._DB_PREFIX_.'tax_rule - WHERE id_tax_rule='.(int)$id_tax_rule - ); + if ($params = Db::getInstance()->getRow(' + SELECT id_country, id_state, zipcode_from, zipcode_to, id_tax, behavior + FROM '._DB_PREFIX_.'tax_rule + WHERE id_tax_rule='.(int)$id_tax_rule + )) { + return Db::getInstance()->getValue(' + SELECT id_tax_rule + FROM '._DB_PREFIX_.'tax_rule + WHERE + id_tax_rules_group = '.(int)$this->id.' AND + id_country='.(int)$params['id_country'].' AND id_state='.(int)$params['id_state'].' AND id_tax='.(int)$params['id_tax'].' AND + zipcode_from=\''.pSQL($params['zipcode_from']).'\' AND zipcode_to=\''.pSQL($params['zipcode_to']).'\' AND behavior='.(int)$params['behavior'] + ); + } - return Db::getInstance()->getValue(' - SELECT id_tax_rule - FROM '._DB_PREFIX_.'tax_rule - WHERE - id_tax_rules_group = '.(int)$this->id.' AND - id_country='.(int)$params['id_country'].' AND id_state='.(int)$params['id_state'].' AND id_tax='.(int)$params['id_tax'].' AND - zipcode_from=\''.pSQL($params['zipcode_from']).'\' AND zipcode_to=\''.pSQL($params['zipcode_to']).'\' AND behavior='.(int)$params['behavior'] - ); + return false; } public static function getTaxRulesGroups($only_active = true)