fbas Posted February 1, 2012 Share Posted February 1, 2012 When we have government purchasers or resellers of our items, we need to exempt them from paying the state tax. How can I do this in Prestashop? Link to comment Share on other sites More sharing options...
fbas Posted February 3, 2012 Author Share Posted February 3, 2012 I couldn't find a way to do this without overriding code. 1) I copied /classes/Tax.php to /override/classes/Tax.php 2) change class definition (line 28) from "class TaxCore extends ObjectModel" to "class Tax extends TaxCore" 3) modify 2 functions, getCarrierTax() AND getProductTaxRate() , to check if address is linked to a user who is placed in a "Tax Exempt" group // put this just inside the "if (!empty($id_address))" block // if $id_address points to a "Tax Exempt" customer, return $0 tax if (is_numeric($id_address)) { $address = new Address((int)($id_address)); // get customer groups to check for tax exempt group $groups = Customer::getGroupsStatic((int)($address->id_customer)); foreach ($groups as $g) { $query = "SELECT name FROM group_lang WHERE id_group=$g AND id_lang=1"; $groupname = Db::getInstance()->getValue($query); if (strtolower(substr($groupname, 0, 10))=="tax exempt") return 0; } } 4) add a group in Back Office named (or at least first 10 characters equal to) "Tax Exempt" in Language 1 (English)* 5) add qualifying customers to Tax Exempt group *note, I hard coded the language to id_lang=1 in the query in the code above. I don't know enough about prestashop to make this more configurable. ** I don't know anything about other taxes (VAT, ecotax) so I didn't change anything there, but you might need to change it for your situation and country. My situation is simple. I only have 1 category of Tax Exempt - they either pay (state) taxes or not. My shop doesn't charge any other taxes (country, etc) so I could safely ignore that. Link to comment Share on other sites More sharing options...
fbas Posted February 3, 2012 Author Share Posted February 3, 2012 I hope future releases of prestashop can put some thought into Tax Exempt customers, though maybe it's more complicated than can be solved in a single generalized way. 1 Link to comment Share on other sites More sharing options...
comprausa Posted March 15, 2012 Share Posted March 15, 2012 I hope too, I tried your override and it does not work for me on v1.4.6.2. I also tried another override http://www.prestashop.com/forums/topic/27003-tax-exempt-module/ It could be me, but I followed all instructions and in both cases I get an empty screen. Link to comment Share on other sites More sharing options...
fbas Posted March 28, 2012 Author Share Posted March 28, 2012 I've upgraded my server (previously Prestashop 1.4.3) to 1.4.7 and it's still working for me. did you get any noticeable error messages? was your cache cleared/disabled? you might also need to make the "Tax Exempt" group the default group for those users. Link to comment Share on other sites More sharing options...
comprausa Posted March 29, 2012 Share Posted March 29, 2012 I will try again in the near future maybe I missed something, I will follow your last suggestions. I'll keep you posted. Thanks. Link to comment Share on other sites More sharing options...
CarriedAwayCrafts Posted May 2, 2012 Share Posted May 2, 2012 I hope future releases of prestashop can put some thought into Tax Exempt customers, though maybe it's more complicated than can be solved in a single generalized way. I hope so too. I really need this (for one group only). But I'm not a coder. Link to comment Share on other sites More sharing options...
transient999 Posted November 28, 2012 Share Posted November 28, 2012 Where do we insert the code below? Can you post the entire Modify Tax.php? I really need to get this working. Thank you // put this just inside the "if (!empty($id_address))" block // if $id_address points to a "Tax Exempt" customer, return $0 tax if (is_numeric($id_address)) { $address = new Address((int)($id_address)); // get customer groups to check for tax exempt group $groups = Customer::getGroupsStatic((int)($address->id_customer)); foreach ($groups as $g) { $query = "SELECT name FROM group_lang WHERE id_group=$g AND id_lang=1"; $groupname = Db::getInstance()->getValue($query); if (strtolower(substr($groupname, 0, 10))=="tax exempt") return 0; } } Link to comment Share on other sites More sharing options...
mohsart Posted November 28, 2012 Share Posted November 28, 2012 Not possible to create a group for those customers with tax excluded? /Mats Link to comment Share on other sites More sharing options...
dsgnmind Posted March 22, 2013 Share Posted March 22, 2013 Does anybody have any info on doing this in 1.5.3 - seems a number of people would like this, including myself. Willing to change files but need assistance. Link to comment Share on other sites More sharing options...
dsgnmind Posted April 9, 2013 Share Posted April 9, 2013 Still looking for a solution here. 1.5.3 Link to comment Share on other sites More sharing options...
shiggidydog Posted July 17, 2013 Share Posted July 17, 2013 I am on prestashop 1.4.9 but you can try the solution I modified for making tax exempt customer groups... I know I wasn't supposed to modify the /classes/Tax.php file but when i created a copy in override of Tax.php I had server errors. So i just went ahead and modified the original /classes/Tax.php file anyways. I have two customer groups (13 and 19) that I want to be tax exempt so I went into Prestashop back office to locate their group id number. After I located it, I applied it to these "if statements", you can modify as necessary or add more if statements for more groups.The non bold/red is original code that is in Tax.php its around line 294 in the file. Be warned though that these changes will be erased if you decide to upgrade Prestashop from your current version. These were my changes in bold/red: if (!empty($id_address)) { if (is_numeric($id_address)) { $address = new Address((int)($id_address)); // get customer groups to check for tax exempt group $groups = Customer::getGroupsStatic((int)($address->id_customer)); foreach ($groups as $g) { if ($g=13) return 0; if ($g=19) return 0; } } $address_infos = Address::getCountryAndState($id_address); if ($address_infos['id_country']) { $id_country = (int)($address_infos['id_country']); $id_state = (int)$address_infos['id_state']; $id_county = (int)County::getIdCountyByZipCode($address_infos['id_state'], $address_infos['postcode']); } if (!empty($address_infos['vat_number']) && $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY') && Configuration::get('VATNUMBER_MANAGEMENT')) return 0; } Hope this helps someone... 1 Link to comment Share on other sites More sharing options...
Pavlos Posted July 18, 2013 Share Posted July 18, 2013 (edited) quik solution for 1.5.x : in the file classes/tax/Tax.php find: public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null) $context = Context::getContext(); $address = Address::initialize($id_address); $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); return $tax_calculator->getTotalRate(); } and replace with public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null) $context = Context::getContext(); $address = Address::initialize($id_address); $groups = Customer::getGroupsStatic((int)($address->id_customer)); $taxratenew = null; foreach ($groups as $g) { if ($g > 4) { //set the group you want here ( '>;' or '=') $taxratenew = 16; //set the tax rate you want here (e.g. "0") [spam-filter] if (!$taxratenew) { $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); $taxratenew = $tax_calculator->getTotalRate(); } return $taxratenew; } Remember to save the file in override/classes/tax/Tax.php and clear cache! Edited July 18, 2013 by Pavlos (see edit history) 1 Link to comment Share on other sites More sharing options...
Smijn1 Posted September 23, 2013 Share Posted September 23, 2013 has anyone tested this with PS 1.5.4.1? Link to comment Share on other sites More sharing options...
dformica Posted October 4, 2013 Share Posted October 4, 2013 Anyone tested this on PS 1.5.5.0 ? Or any other solutions? Link to comment Share on other sites More sharing options...
dformica Posted October 15, 2013 Share Posted October 15, 2013 quik solution for 1.5.x : in the file classes/tax/Tax.php find: public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null) $context = Context::getContext(); $address = Address::initialize($id_address); $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); return $tax_calculator->getTotalRate(); } and replace with public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null) $context = Context::getContext(); $address = Address::initialize($id_address); $groups = Customer::getGroupsStatic((int)($address->id_customer)); $taxratenew = null; foreach ($groups as $g) { if ($g > 4) { //set the group you want here ( '>;' or '=') $taxratenew = 16; //set the tax rate you want here (e.g. "0") [spam-filter] if (!$taxratenew) { $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); $taxratenew = $tax_calculator->getTotalRate(); } return $taxratenew; }Remember to save the file in override/classes/tax/Tax.php and clear cache! I followed your instructions but It doesn't work for me on 1.5.6.0 Link to comment Share on other sites More sharing options...
dformica Posted October 15, 2013 Share Posted October 15, 2013 Nevermind it works!!! My string is "Dealer" instead of "empresa" I had entered with capital D and didn't realize it was searching for the string in lowercase if (strtolower(substr($groupname, 0, 6))=="dealer"){ Thank you everyone in this forum! Link to comment Share on other sites More sharing options...
GeertN Posted December 16, 2013 Share Posted December 16, 2013 When I set $taxratenew to "0" It doesn't work for me. When I set it to "5" or something it works. Anyone solution?Using 1.5.6.1 Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted August 21, 2014 Share Posted August 21, 2014 I know this is an old post, but I wanted to confirm that I tried this on 1.5.6.2 and it works just fine. Great fix! Just remember not to overwrite it during upgrades. quik solution for 1.5.x :in the file classes/tax/Tax.php find: public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null) $context = Context::getContext(); $address = Address::initialize($id_address); $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); return $tax_calculator->getTotalRate(); } and replace with public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null) $context = Context::getContext(); $address = Address::initialize($id_address); $groups = Customer::getGroupsStatic((int)($address->id_customer)); $taxratenew = null; foreach ($groups as $g) { if ($g > 4) { //set the group you want here ( '>;' or '=') $taxratenew = 16; //set the tax rate you want here (e.g. "0") [spam-filter] if (!$taxratenew) { $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); $taxratenew = $tax_calculator->getTotalRate(); } return $taxratenew; }Remember to save the file in override/classes/tax/Tax.php and clear cache! Link to comment Share on other sites More sharing options...
shaun_imakr Posted November 3, 2014 Share Posted November 3, 2014 When I set $taxratenew to "0" It doesn't work for me. When I set it to "5" or something it works. Anyone solution? Using 1.5.6.1 Same thing happened in my case. I changed it in the end to 0.0001 and it's working now. Prestashop 1.6.0.9 Link to comment Share on other sites More sharing options...
hipeq Posted April 23, 2015 Share Posted April 23, 2015 I have tried to do put this code into override/classes/tax/Taxes.php public static function getProductTaxRate($id_product, $id_address = null, Context $context = null){if ($context == null)$context = Context::getContext();$address = Address::initialize($id_address);$groups = Customer::getGroupsStatic((int)($address->id_customer));$taxratenew = null;foreach ($groups as $g) {if ($g > 4) { //set the group you want here ( '>;' or '=') $taxratenew = 16; //set the tax rate you want here (e.g. "0")[spam-filter]if (!$taxratenew) {$id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context);$tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules);$tax_calculator = $tax_manager->getTaxCalculator();$taxratenew = $tax_calculator->getTotalRate();}return $taxratenew;} However, no matter how much I clear cache I can not get it to generate order without tax for a Tax Exempt distributor. Any thoughts? Using Prestashop 1.6.0.14 Thank you, 1 Link to comment Share on other sites More sharing options...
Christian Alias Posted October 8, 2015 Share Posted October 8, 2015 (edited) Hi all, If tried in prestashop 1.6.0.9 and it doesn't work even if I do the following: public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null) $context = Context::getContext(); $address = Address::initialize($id_address); $groups = Customer::getGroupsStatic((int)($address->id_customer)); $taxratenew = null; foreach ($groups as $g) { if ($g > 4) { //set the group you want here ( '>;' or '=') $taxratenew = 16; //set the tax rate you want here (e.g. "0") [spam-filter] if (!$taxratenew) { $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); $taxratenew = $tax_calculator->getTotalRate(); } return 16; //hard coded 16 just to si if something changes in my override file and also in the core file } after doing this I get the same tax as I had allways... Anybody knows why ? thanks in advance Edited October 8, 2015 by Christian Alias (see edit history) Link to comment Share on other sites More sharing options...
piotr94 Posted March 11, 2016 Share Posted March 11, 2016 (edited) public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null) $context = Context::getContext(); $address = Address::initialize($id_address); $groups = Customer::getGroupsStatic((int)($address->id_customer)); $taxratenew = null; foreach ($groups as $g) { if ($g == 8 || $g == 9) { //set the group you want here ( '>;' or '=') return 0; //set the tax rate you want here (e.g. "0") } } if (!$taxratenew) { $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); $taxratenew = $tax_calculator->getTotalRate(); } return $taxratenew; } Try this, it works with tax = 0; Edited March 11, 2016 by piotr94 (see edit history) Link to comment Share on other sites More sharing options...
Zadara Posted April 22, 2016 Share Posted April 22, 2016 (edited) public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null) $context = Context::getContext(); $address = Address::initialize($id_address); $groups = Customer::getGroupsStatic((int)($address->id_customer)); $taxratenew = null; foreach ($groups as $g) { if ($g == 8 || $g == 9) { //set the group you want here ( '>;' or '=') return 0; //set the tax rate you want here (e.g. "0") } } if (!$taxratenew) { $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); $taxratenew = $tax_calculator->getTotalRate(); } return $taxratenew; } Try this, it works with tax = 0; Would you explain this somewhat more? I have replaced your function with the 'regular' getProductTaxRate function in classes/tax/Tax.php. But is does not work, I have only changed the groups numbers from '8' and '9' to '4' Btw: Wha do you mean with: it works with tax = 0; ? Edited April 22, 2016 by Zadara (see edit history) Link to comment Share on other sites More sharing options...
heyho Posted June 1, 2016 Share Posted June 1, 2016 Hi, today i had the same Problem.. I have ONE UserGroup that should not have any TAX (not in Product-List and not in Cart). I tried the suggestions above but had no success... I found the Class TaxCalculatorCore in /classes/tax/TaxCalculator.php and modified the Method getTaxesTotalAmount($price_te) /** * Return the total taxes amount * * @param float $price_te * @return float $amount */ public function getTaxesTotalAmount($price_te) { $amount = 0; $taxes = $this->getTaxesAmount($price_te); foreach ($taxes as $tax) $amount += $tax; $context = Context::getContext(); if($context->customer->id_default_group == 17 ) // 17 is the UserGroup whith no tax return 0; else return $amount; } Seems also to work on on invoice and E-Mails tested: Prestashop 1.6.0.14 SRY: I have no idea how to override this.. maybe someone could to that and provide the file?! Link to comment Share on other sites More sharing options...
Christian Alias Posted June 1, 2016 Share Posted June 1, 2016 Hi, today i had the same Problem.. I have ONE UserGroup that should not have any TAX (not in Product-List and not in Cart). I tried the suggestions above but had no success... I found the Class TaxCalculatorCore in /classes/tax/TaxCalculator.php and modified the Method getTaxesTotalAmount($price_te) /** * Return the total taxes amount * * @param float $price_te * @return float $amount */ public function getTaxesTotalAmount($price_te) { $amount = 0; $taxes = $this->getTaxesAmount($price_te); foreach ($taxes as $tax) $amount += $tax; $context = Context::getContext(); if($context->customer->id_default_group == 17 ) // 17 is the UserGroup whith no tax return 0; else return $amount; } Seems also to work on on invoice and E-Mails tested: Prestashop 1.6.0.14 SRY: I have no idea how to override this.. maybe someone could to that and provide the file?! Hello! you have to create this directory: override/classes/tax/TaxCalculator.php and TaxCalculator.php should be: <?php class TaxCalculator extends TaxCalculatorCore { public function getTaxesTotalAmount($price_te) { $amount = 0; $taxes = $this->getTaxesAmount($price_te); foreach ($taxes as $tax) $amount += $tax; $context = Context::getContext(); if($context->customer->id_default_group == 17 ) // 17 is the UserGroup whith no tax return 0; else return $amount; } } I'm not 100% shure because I haven't tried but that should work, now leave the original file in classes/tax/TaxCalculator.php like it was before you modified good luck! 1 Link to comment Share on other sites More sharing options...
heyho Posted June 2, 2016 Share Posted June 2, 2016 THX!!! Override works now :-) Link to comment Share on other sites More sharing options...
Christian Alias Posted June 2, 2016 Share Posted June 2, 2016 your welcome! Link to comment Share on other sites More sharing options...
Pr0t3us Posted July 29, 2016 Share Posted July 29, 2016 (edited) Hi all I wonder what I did wrong, those several methods does not works ... I tried the last one I duplicated TaxCalculator.php in Override/classes/tax erase inside and replace with this <?phpclass TaxCalculator extends TaxCalculatorCore{public function getTaxesTotalAmount($price_te){ $amount = 0; $taxes = $this->getTaxesAmount($price_te); foreach ($taxes as $tax) $amount += $tax; $context = Context::getContext(); if($context->customer->id_default_group == 4 ) // 4 is my UserGroup whith no tax return 0; else return $amount;}} Edited July 29, 2016 by Pr0t3us (see edit history) Link to comment Share on other sites More sharing options...
Sridhar09 Posted July 29, 2016 Share Posted July 29, 2016 When I set $taxratenew to "0" It doesn't work for me. When I set it to "5" or something it works. Anyone solution? Using 1.5.6.1 I know this is an old comment but for any looking for a solution here, you can try public static function getProductTaxRate($id_product, $id_address = null, Context $context = null) { if ($context == null){ $context = Context::getContext(); } $address = Address::initialize($id_address); $groups = Customer::getGroupsStatic((int)($address->id_customer)); $taxratenew; foreach ($groups as $g){ if ($g == 5){ //set the group you want here ( '>;' or '=') $taxratenew = 0; } } if(!isset($taxratenew)){ $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context); $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules); $tax_calculator = $tax_manager->getTaxCalculator(); $taxratenew = $tax_calculator->getTotalRate(); } return $taxratenew; } } File : /classes/tax/Tax.php Do not forget to override it in override/classes/tax/Tax.php The solution works in 1.6.0.x Link to comment Share on other sites More sharing options...
aaronsuncamacho Posted July 30, 2016 Share Posted July 30, 2016 (edited) Thanks to everyone on this thread who has worked to hack a feature into Prestashop that should be part of its default core options But, I have tried everything in this thread (some of which is conflicting) and can not get it to work! Someone please write a one post only set of instructions on what files to change and where to make one group tax exempt? ( I am running Prestashop 1.6.1.6 )Thank You All, Aaron rhizOHM.co Edited July 31, 2016 by aaronsuncamacho (see edit history) Link to comment Share on other sites More sharing options...
televi Posted October 25, 2016 Share Posted October 25, 2016 (edited) Did anyone find a solution for 1.6.1.17? I tried adding that code to override/classes/tax/TaxCalculator.php and it does NOT work for me. override/classes/tax/TaxCalculator.php reads: <?php class TaxCalculator extends TaxCalculatorCore { public function getTaxesTotalAmount($price_te) { $amount = 0; $taxes = $this->getTaxesAmount($price_te); foreach ($taxes as $tax) $amount += $tax; $context = Context::getContext(); if($context->customer->id_default_group == 46 ) // 17 is the UserGroup whith no tax return 0; else return $amount; } } Am I missing anything? Do i need any other code to change in any of the other PHP files? Edited October 25, 2016 by televi (see edit history) Link to comment Share on other sites More sharing options...
LeahCorbett Posted May 19, 2017 Share Posted May 19, 2017 PRESTASHOP DEVELOPERS!! This is such an obviously needed function that should be part of the store without any hacking, or addon modules. And if not, then a Prestashop Developer should reply to this thread and help all of us who need this. I'm so frustrated. Link to comment Share on other sites More sharing options...
TristanBerger Posted May 23, 2017 Share Posted May 23, 2017 For anybody else who finds themselves here, the older solutions don't work on 1.6.1.9, this does: Create the customer group that you want to tax-exempt and get its ID (it's displayed in the admin panel view of customer groups). Copy "[prestashop root]/classes/tax/TaxRulesTaxManager.php" to "[prestashop root]/override/classes/tax/TaxRulesTaxManager.php" In "[prestashop root]/override/classes/tax/TaxRulesTaxManager.php", in function "getTaxCalculator", replace "$tax_enabled = $this->configurationManager->get('PS_TAX');" with "$tax_enabled = $this->configurationManager->get('PS_TAX') && !in_array(GROUP_ID, Customer::getGroupsStatic($this->address->id_customer));", replacing GROUP_ID with the group ID we found earlier. Delete "[prestashop root]/cache/class_index.php" so PrestaShop looks for then uses your override, rather than the unmodified original TaxRulesTaxManager.php file. If you're reading this long after I post it, and the solution obsoleted again, I recommend approaching the problem by looking for everywhere the PS_TAX configuration option is consulted and, where appropriate, creating an override that also checks the customer group ID. PrestaShop devs, please implement this natively, it will save many of us time and frustration, and reduce bugs in the average PrestaShop install. 1 Link to comment Share on other sites More sharing options...
LeahCorbett Posted May 23, 2017 Share Posted May 23, 2017 @twhb THANK YOU FOR DOING WHAT PRESTA DEVS SHOULD HAVE DONE FROM THE GET GO!!! Link to comment Share on other sites More sharing options...
El Patron Posted May 24, 2017 Share Posted May 24, 2017 There is also this module on addon's, I have not used it but seems simple enough. https://addons.prestashop.com/en/b2b/5809-tax-exempt.html Link to comment Share on other sites More sharing options...
LeahCorbett Posted May 24, 2017 Share Posted May 24, 2017 @El Patron. Yes, I know about that addon, which to me is $45. I appreciate you posting that for people who don't have a developer on staff. I just wish the prestashop developers were more helpful in contributing to the forum, AND that a tax exempt group was already available in the standard store. We switched from OpenCart to Prestashop for various reasons of functionality, but had I known the forum wasn't being assisted by PS Devs, I might not have switched. When I had questions for the OpenCart community, they were answered in minutes or hours, and sometimes a day or 2. But in PS forums I see things going for weeks and months and sometimes totally unanswered for years. It's very disappointing. Link to comment Share on other sites More sharing options...
El Patron Posted May 24, 2017 Share Posted May 24, 2017 @El Patron. Yes, I know about that addon, which to me is $45. I appreciate you posting that for people who don't have a developer on staff. I just wish the prestashop developers were more helpful in contributing to the forum, AND that a tax exempt group was already available in the standard store. We switched from OpenCart to Prestashop for various reasons of functionality, but had I known the forum wasn't being assisted by PS Devs, I might not have switched. When I had questions for the OpenCart community, they were answered in minutes or hours, and sometimes a day or 2. But in PS forums I see things going for weeks and months and sometimes totally unanswered for years. It's very disappointing. Yes, I see value of this being a native feature. The only way you can get that on roadmap is to open a feature request here: http://forge.prestashop.com This is the only place you can be heard by PS. The forum is pretty much entirely community. Link to comment Share on other sites More sharing options...
Jameh Posted August 24, 2019 Share Posted August 24, 2019 On 5/23/2017 at 2:40 PM, twhb said: For anybody else who finds themselves here, the older solutions don't work on 1.6.1.9, this does: Create the customer group that you want to tax-exempt and get its ID (it's displayed in the admin panel view of customer groups). Copy "[prestashop root]/classes/tax/TaxRulesTaxManager.php" to "[prestashop root]/override/classes/tax/TaxRulesTaxManager.php" In "[prestashop root]/override/classes/tax/TaxRulesTaxManager.php", in function "getTaxCalculator", replace "$tax_enabled = $this->configurationManager->get('PS_TAX');" with "$tax_enabled = $this->configurationManager->get('PS_TAX') && !in_array(GROUP_ID, Customer::getGroupsStatic($this->address->id_customer));", replacing GROUP_ID with the group ID we found earlier. Delete "[prestashop root]/cache/class_index.php" so PrestaShop looks for then uses your override, rather than the unmodified original TaxRulesTaxManager.php file. If you're reading this long after I post it, and the solution obsoleted again, I recommend approaching the problem by looking for everywhere the PS_TAX configuration option is consulted and, where appropriate, creating an override that also checks the customer group ID. PrestaShop devs, please implement this natively, it will save many of us time and frustration, and reduce bugs in the average PrestaShop install. This way works for newest version 1.7.6.0 as well, and free. Thanks 1 Link to comment Share on other sites More sharing options...
Ezequielb Posted April 1, 2020 Share Posted April 1, 2020 (edited) Hello, Code It is working at some point, but it is removing tax also for tax paying groups. Is there any update of this override for PS 1.7.6.x?? Best regards! Edited April 1, 2020 by Ezequielb (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now