[-] FO : getTaxCalculator bad cache key

This commit is contained in:
gRoussac
2013-11-11 00:13:35 +01:00
parent 19da345531
commit 7e93b2cffd
+4 -4
View File
@@ -80,7 +80,8 @@ class TaxRulesTaxManagerCore implements TaxManagerInterface
if (!empty($this->address->postcode)) if (!empty($this->address->postcode))
$postcode = $this->address->postcode; $postcode = $this->address->postcode;
if (!isset(self::$cache_tax_calculator[(int)$this->address->id_country.'-'.$postcode.'-'.$this->type])) $key = (int)$this->address->id_country.'-'.$postcode.'-'.(int)$this->type;
if (!isset(self::$cache_tax_calculator[$key]))
{ {
$rows = Db::getInstance()->executeS(' $rows = Db::getInstance()->executeS('
SELECT * SELECT *
@@ -111,10 +112,9 @@ class TaxRulesTaxManagerCore implements TaxManagerInterface
break; break;
} }
self::$cache_tax_calculator[$postcode.'-'.$this->type] = new TaxCalculator($taxes, $behavior); self::$cache_tax_calculator[$key] = new TaxCalculator($taxes, $behavior);
} }
return self::$cache_tax_calculator[$key];
return self::$cache_tax_calculator[$postcode.'-'.$this->type];
} }
} }