[-] FO : Fix bug #PSCFV-8917 taxes calculation when changing delivery address
This commit is contained in:
1 parent
332d68c7ec
commit
f94f0f14a4
2 files changed
+13
-6
No files matched your search
+12
-5
@@ -3415,6 +3415,7 @@ class CartCore extends ObjectModel
|
|||||||
*/
|
*/
|
||||||
public function setNoMultishipping()
|
public function setNoMultishipping()
|
||||||
{
|
{
|
||||||
|
$emptyCache = $result = false;
|
||||||
if (Configuration::get('PS_ALLOW_MULTISHIPPING'))
|
if (Configuration::get('PS_ALLOW_MULTISHIPPING'))
|
||||||
{
|
{
|
||||||
// Upgrading quantities
|
// Upgrading quantities
|
||||||
@@ -3433,7 +3434,9 @@ class CartCore extends ObjectModel
|
|||||||
AND `id_shop` = '.(int)$this->id_shop.'
|
AND `id_shop` = '.(int)$this->id_shop.'
|
||||||
AND id_product = '.$product['id_product'].'
|
AND id_product = '.$product['id_product'].'
|
||||||
AND id_product_attribute = '.$product['id_product_attribute'];
|
AND id_product_attribute = '.$product['id_product_attribute'];
|
||||||
Db::getInstance()->execute($sql);
|
$result = Db::getInstance()->execute($sql);
|
||||||
|
if ($result)
|
||||||
|
$emptyCache = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merging multiple lines
|
// Merging multiple lines
|
||||||
@@ -3451,15 +3454,16 @@ class CartCore extends ObjectModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update delivery address for each product line
|
// Update delivery address for each product line
|
||||||
Db::getInstance()->execute('
|
$sql = 'UPDATE `'._DB_PREFIX_.'cart_product`
|
||||||
UPDATE `'._DB_PREFIX_.'cart_product`
|
|
||||||
SET `id_address_delivery` = (
|
SET `id_address_delivery` = (
|
||||||
SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
|
SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
|
||||||
WHERE `id_cart` = '.(int)$this->id.' AND `id_shop` = '.(int)$this->id_shop.'
|
WHERE `id_cart` = '.(int)$this->id.' AND `id_shop` = '.(int)$this->id_shop.'
|
||||||
)
|
)
|
||||||
WHERE `id_cart` = '.(int)$this->id.'
|
WHERE `id_cart` = '.(int)$this->id.'
|
||||||
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : ''));
|
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : '');
|
||||||
|
|
||||||
|
$emptyCache = Db::getInstance()->execute($sql);
|
||||||
|
|
||||||
if (Customization::isFeatureActive())
|
if (Customization::isFeatureActive())
|
||||||
Db::getInstance()->execute('
|
Db::getInstance()->execute('
|
||||||
UPDATE `'._DB_PREFIX_.'customization`
|
UPDATE `'._DB_PREFIX_.'customization`
|
||||||
@@ -3468,6 +3472,9 @@ class CartCore extends ObjectModel
|
|||||||
WHERE `id_cart` = '.(int)$this->id.'
|
WHERE `id_cart` = '.(int)$this->id.'
|
||||||
)
|
)
|
||||||
WHERE `id_cart` = '.(int)$this->id);
|
WHERE `id_cart` = '.(int)$this->id);
|
||||||
|
|
||||||
|
if ($emptyCache)
|
||||||
|
$this->_products = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ 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[$postcode.'-'.$this->type]))
|
if (!isset(self::$cache_tax_calculator[(int)$this->address->id_country.'-'.$postcode.'-'.$this->type]))
|
||||||
{
|
{
|
||||||
$rows = Db::getInstance()->executeS('
|
$rows = Db::getInstance()->executeS('
|
||||||
SELECT *
|
SELECT *
|
||||||
|
|||||||
Reference in new issue
Block a user