• Join Now
  • Sign In
  • Cart
  • Instant Setup
  • Download
Logo
  • About
    • For Developers
    • For Agencies
    • For Designers
    • For Anyone
    • Testimonials
    • Showcase
    • Our Philosophy
    • Blog
    • Instant Setup
  • Community
    • Members
    • Forums
    • Chat
    • Karma
    • International
    • Jobs
    • eNewsletters
  • Developers
    • Download concrete5
    • Join Beta Team
    • Translate concrete5
    • Bug Tracker
    • Submit to Marketplace
    • Code Submissions
    • News
    • Community Leaders
    • Related Projects
  • Marketplace
    • Add-Ons
    • Themes
    • Hosting
    • Training
    • Add-on Installation
    • Deal Of The Day
    • Swag
  • Enterprise
  • Documentation
    • Getting Started
    • Editor's Guide
    • Learn concrete5
    • Developers Index
    • How-Tos
  • How-Tos

How To Turn Off Sales Tax By User Group in eCommerce

Posted byEvanCooper in Developers on Apr 04, 2012.
1 person likes this.

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.

How-To Tags

ecommerce, users, groups, exempt, sales tax

Related How-Tos

None.

  • Documentation
  • How-Tos
  • Developers
  • How To Turn Off Sales Tax By User Group in eCommerce

Do you have questions

  • What are users saying?
  • Who is using concrete5?
  • What makes concrete5 easy?
  • Why develop on concrete5?
 

We’re on “The Twitter”

Building w #Concrete5 and need help? Check out my course on Udemy! http://t.co/K2d4xmyR1C #cms @snewmandesign

Follow concrete5

About

  • For Developers
  • For Agencies
  • For Designers
  • For Anyone
  • Testimonials
  • Showcase
  • Our Philosophy
  • Blog
  • Instant Setup

Community

  • Members
  • Forums
  • Chat
  • International
  • Jobs
  • eNewsletters

Developers

  • Download concrete5
  • Join Beta Team
  • Translate concrete5
  • Bug Tracker
  • Beta
  • Submit to Marketplace
  • Code Submissions
  • News
  • Community Leaders
  • User Doc Group
  • Related Projects

Marketplace

  • Add-Ons
  • Themes
  • Hosting
  • Training
  • Add-on Installation
  • Deal Of The Day
  • Swag

Documentation

  • Getting Started
  • Editor's Guide
  • Learn concrete5
  • Developers Index
  • How-Tos

Legal

  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Contact Us
© 2008 to 2013 Concrete CMS Inc. All Rights Reserved.

Sign In?

You must have a user account and be signed to perform this action.

  • Sign In
  • Register