This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

Say you have a group of users that you would like to exempt from sales tax. You would first create a group for the users you want to be exempt. Let's name the group 'untaxed'. Then you would head over to core_commerce/models/sales/tax/rate.php. Override that guy, then add the following at approximately line 172 (at the end of the checks to determine whether or not to apply tax:

$u = new User();
            $group = Group::getByName('untaxed');
            if(is_object($group) && is_object($u)) {
                $untaxed = $u->inGroup($group);
                if ($untaxed) {
                    $doTax = false;
                }
            }

Let's break this down: First we're grabbing the current user object. Then we're defining a variable with the group object of the group named 'untaxed' (or whatever you'd like to name it). Then, we are checking that these are indeed objects so we don't go forward with bad data in our variables and cause unintended mischief. Then we are checking if the user is in the group we defined, and then, if they are (that is, if $u->inGroup($group) returns 'true'), then we define $doTax as false, and our target user group gets through checkout without getting dinged for taxes.

Loading Conversation