Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default creating tax exempt status for wholesale customers?

    Based on another old thread, I have added this line to the function_taxes.php right after the global db line
    Code:
    if ($_SESSION['customer_whole'] != '0') {
          return 0;
        }
    I printed the sessions and this does exist:
    [customer_whole] => 1

    But it's still adding tax. What am I missing here? This sounds like it should work.
    The full-time Zen Cart Guru. WizTech4ZC.com

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: creating tax exempt status for wholesale customers?

    There are many functions in that file. Which one are you referring to? What exactly are you wanting to accomplish?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default Re: creating tax exempt status for wholesale customers?

    oops, sorry!

    zen_get_tax_rate so that the first of the functions reads like this:
    Code:
      function zen_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
    
        global $db;
    
    if ($_SESSION['customer_whole'] != '0') {
          return 0;
        }
    Trying to override the sales tax if the customer is wholesale and charge then no tax.

    Thanks!
    The full-time Zen Cart Guru. WizTech4ZC.com

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: creating tax exempt status for wholesale customers?

    If $_SESSION doesn't contain 'customer_whole' then you've got a problem elsewhere that's preventing it from being set. It won't be related to the code in that function.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default Re: creating tax exempt status for wholesale customers?

    The session does contain it though.
    Code:
    [customer_country_id] => 223
        [customer_zone_id] => 12
        [customer_whole] => 1
    The full-time Zen Cart Guru. WizTech4ZC.com

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: creating tax exempt status for wholesale customers?

    Then try a few different things:
    a) 0 is not the same as '0'. 0 is a number. '0' is a string.
    b) typecasting the session var as int might be good too

    ie:
    Code:
    if ((int)$_SESSION['customer_whole'] > 0 ) {
    PHP is pretty tolerant to those though, so I wouldn't be surprised if making the change doesn't make much difference, despite the suggested change being better written.


    Have you looked at the various tax-exempt addons to see what they're doing? Maybe your approach is missing various other components involved.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default Re: creating tax exempt status for wholesale customers?

    All of the other tax exempt mods use a separate table to store the customers in - each customer has to be designated as tax exempt separately so I was wanting to do a one time swoop for all of them instead.

    Is the logic sound? Seems to me it should work, ie if the customer is wholesale, return 0 for taxes? (I may be showing my php ignorance here)

    I tried your suggestion and a few of my own ideas but no dice. I took the idea for this from here

    http://www.zen-cart.com/forum/showth...ups+tax+exempt

    The full-time Zen Cart Guru. WizTech4ZC.com

  8. #8
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default Re: creating tax exempt status for wholesale customers?

    I went and looked at the logic from that exempt mod and it was similar though more complicated than I think is necessary for my specific situation.

    I even took that mod and substituted in the appropriate places and no dice.

    Didn't think this was going to be so difficult but I'm running in more clients who are doing both wholesale and retail in the same cart and this has to happen somehow.
    The full-time Zen Cart Guru. WizTech4ZC.com

  9. #9
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: creating tax exempt status for wholesale customers?

    So, are you saying that if you add a line like the following to the beginning of the zen_get_tax_rate() function, it IS showing customers_whole = 1 ?
    Code:
    die('$_SESSION contains: ' . print_r($_SESSION, true));
    (when the customer is logged in as a wholesale customer)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: creating tax exempt status for wholesale customers?

    Also note, if you're seeing wrong tax stuff on checkout confirmation, you'll need to do a similar "return 0" in zen_get_multiple_tax_rates() as well.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139d order hold status for Wholesale customers
    By aditya369 in forum Managing Customers and Orders
    Replies: 2
    Last Post: 23 Oct 2012, 08:36 PM
  2. v139h No Tax for Wholesale customers
    By aditya369 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 18 May 2012, 04:07 AM
  3. How to not charge tax for wholesale customers?
    By bluealice in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 16 Oct 2007, 11:22 AM
  4. SQL update for Tax Exempt Status module
    By TheMusician in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 9 Jul 2007, 09:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR