[-] FO : Fix bug #PSCFV-10606 could not have correct taxCalculationMethod when vat number in customer address
This commit is contained in:
1 parent
7d0e9a5f06
commit
e4a642128a
2 files changed
+14
-1
No files matched your search
@@ -519,6 +519,17 @@ class ProductCore extends ObjectModel
|
|||||||
if (!Validate::isLoadedObject($customer))
|
if (!Validate::isLoadedObject($customer))
|
||||||
die(Tools::displayError());
|
die(Tools::displayError());
|
||||||
self::$_taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group);
|
self::$_taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group);
|
||||||
|
$cur_cart = Context::getContext()->cart;
|
||||||
|
$id_address = 0;
|
||||||
|
if (Validate::isLoadedObject($cur_cart))
|
||||||
|
$id_address = $cur_cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')};
|
||||||
|
$address_infos = Address::getCountryAndState($id_address);
|
||||||
|
|
||||||
|
if (self::$_taxCalculationMethod != PS_TAX_EXC
|
||||||
|
&& !empty($address_infos['vat_number'])
|
||||||
|
&& $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY')
|
||||||
|
&& Configuration::get('VATNUMBER_MANAGEMENT'))
|
||||||
|
self::$_taxCalculationMethod = PS_TAX_EXC;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
self::$_taxCalculationMethod = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
self::$_taxCalculationMethod = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||||
|
|||||||
@@ -251,6 +251,8 @@ class FrontControllerCore extends Controller
|
|||||||
$this->context->cart = $cart;
|
$this->context->cart = $cart;
|
||||||
CartRule::autoAddToCart($this->context);
|
CartRule::autoAddToCart($this->context);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
$this->context->cart = $cart;
|
||||||
|
|
||||||
/* get page name to display it in body id */
|
/* get page name to display it in body id */
|
||||||
|
|
||||||
@@ -325,7 +327,7 @@ class FrontControllerCore extends Controller
|
|||||||
'currencies' => Currency::getCurrencies(),
|
'currencies' => Currency::getCurrencies(),
|
||||||
'languages' => $languages,
|
'languages' => $languages,
|
||||||
'meta_language' => implode('-', $meta_language),
|
'meta_language' => implode('-', $meta_language),
|
||||||
'priceDisplay' => Product::getTaxCalculationMethod(),
|
'priceDisplay' => Product::getTaxCalculationMethod((int)$this->context->cookie->id_customer),
|
||||||
'add_prod_display' => (int)Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
|
'add_prod_display' => (int)Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
|
||||||
'shop_name' => Configuration::get('PS_SHOP_NAME'),
|
'shop_name' => Configuration::get('PS_SHOP_NAME'),
|
||||||
'roundMode' => (int)Configuration::get('PS_PRICE_ROUND_MODE'),
|
'roundMode' => (int)Configuration::get('PS_PRICE_ROUND_MODE'),
|
||||||
|
|||||||
Reference in new issue
Block a user