handling tax exempt customers

Permalink
I have been working all morning trying to figure out how to do this.

Most of my customers buy from me and resell to their customers, so they are exempt from me charging them sales tax. However, I also have customers who must pay sales tax.

Is there a SIMPLE way to handle this? I am using the core eCommerce.

thanks so much

 
Mainio replied on at Permalink Best Answer Reply
Mainio
This can be achieved but maybe not as "simply" as you would hope for. You need to know some PHP to be able to do this.

This is what I'd suggest:
1. You MUST require login for the customers who are not charged tax
2. I would create a user group for those customers where I'd add them
3. You need to create an override to the /packages/core_commerce/models/sales/tax/rate.php, so copy that into /models/sales/tax/ folder.

The function you want to look into when deciding whether to charge the tax or not is setupEnabledRates() in that class.

Getting the logged in user and checking whether they belong to a group:
global $u; // Stores the logged in user
$g = Group::getByName('Your Custom Group'); // Get the user group
if (!$u || !$u->inGroup($g)) {
   // TODO: Charge sales tax
}


Br,
Antti / Mainio
treypaul replied on at Permalink Reply
Thank you very much mainio. I figured I would have to do it just the way you described. Since I just started using Concrete5 a few weeks ago, I am still not familiar where to find everything and what all the globals contain.

This is very helpful and save me probably hours of just looking where to edit.
Mainio replied on at Permalink Reply
Mainio
I noticed a small glitch in the if-statement so I edited the code above and fixed it.
treypaul replied on at Permalink Reply
Manio,
Just wanted to say I got this working today. Again, thanks very much.