Show (tax excl.) label in carrier list and shopping cart summary
When tax exempt for EU Tax registered subjects is active, by default Prestashop core does not set (tax excl.) properly for guests. To solve it, update classes/Product.php, method initPricesComputation.
Edit file: classes/Product.php
and modify else { ... }
clause, as highlighted:
public static function initPricesComputation($id_customer = null)
{
if ((int)$id_customer > 0) {
$customer = new Customer((int)$id_customer);
if (!Validate::isLoadedObject($customer)) {
die(Tools::displayError());
}
self::$_taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group);
$cur_cart = Context::getContext()->cart;
$id_address = 0;
if (Validate::isLoadedObject($cur_cart)) {
$id_address = (int)$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 {
self::$_taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group);
$cur_cart = Context::getContext()->cart;
$id_address = 0;
if (Validate::isLoadedObject($cur_cart)) {
$id_address = (int)$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 {
self::$_taxCalculationMethod = Group::getPriceDisplayMethod(Group::getCurrent()->id);
}
}
}