Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    Join Date
    May 2006
    Posts
    30
    Plugin Contributions
    0

    Charge only one tax from resellers

    Hi

    I am from Ontario, Canada. Here we charge two taxes from end customers - GST (federal) and PST (provincial). But from resellers we only charge GST.

    I have installed Dual Pricing mod on my site which allows me to show wholesale prices to resellers and retail price to end customers.

    I have only one problem, on checkout, it adds both taxes to resellers.

    What do I need to change to only charge GST from resellers?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Posts
    13
    Plugin Contributions
    0

    Idea or Suggestion Re: Charge only one tax from resellers

    Did Anyone figure this out yet?

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Charge only one tax from resellers

    You'll need to write new code to exclude taxes from certain customers.
    .

    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.

  4. #4
    Join Date
    Jan 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: Charge only one tax from resellers

    Thaks for replying, but I really am not sure how to do that.

  5. #5
    Join Date
    May 2006
    Posts
    30
    Plugin Contributions
    0

    Default Re: Charge only one tax from resellers

    Hi scully2569

    I was not sure if anybody else needs this. I am not expert, but I managed to hack the code to my needs. Here is how I did it -

    Please note that you need to have the "dual_pricing_1_3" module installed before making this change.

    Open the file includes/functions/functions_taxes.php

    Close to line 32, look for -

    PHP Code:
        $tax_query "select sum(tax_rate) as tax_rate
                      from (" 
    TABLE_TAX_RATES " tr
                      left join " 
    TABLE_ZONES_TO_GEO_ZONES " za on (tr.tax_zone_id = za.geo_zone_id)
                      left join " 
    TABLE_GEO_ZONES " tz on (tz.geo_zone_id = tr.tax_zone_id) )
                      where (za.zone_country_id is null
                      or za.zone_country_id = 0
                      or za.zone_country_id = '" 
    . (int)$country_id "')
                      and (za.zone_id is null
                      or za.zone_id = 0
                      or za.zone_id = '" 
    . (int)$zone_id "')
                      and tr.tax_class_id = '" 
    . (int)$class_id "'
                      group by tr.tax_priority"

    Replace it with -

    PHP Code:
    // KLUDGE START by Harmeet - To charge only GST from resellers.
    if ($_SESSION['customer_id']) {
        
    $customers_id $_SESSION['customer_id'];
        
    $customer_check $db->Execute("select * from " TABLE_CUSTOMERS " where customers_id = '$customers_id'");
        if (
    $customer_check->fields['customers_whole'] != "0") {
            
    $whole 1;
        }
    }
    if (
    $whole) {
        
    $tax_query "select tax_rate as tax_rate
                      from (" 
    TABLE_TAX_RATES " tr
                      left join " 
    TABLE_ZONES_TO_GEO_ZONES " za on (tr.tax_zone_id = za.geo_zone_id)
                      left join " 
    TABLE_GEO_ZONES " tz on (tz.geo_zone_id = tr.tax_zone_id) )
                      where (za.zone_country_id is null
                      or za.zone_country_id = 0
                      or za.zone_country_id = '" 
    . (int)$country_id "')
                      and (za.zone_id is null
                      or za.zone_id = 0
                      or za.zone_id = '" 
    . (int)$zone_id "')
                      and tr.tax_class_id = '" 
    . (int)$class_id "'
                      group by tr.tax_priority"
    ;
    }
    else {
    // KLUDGE END
        
    $tax_query "select sum(tax_rate) as tax_rate
                      from (" 
    TABLE_TAX_RATES " tr
                      left join " 
    TABLE_ZONES_TO_GEO_ZONES " za on (tr.tax_zone_id = za.geo_zone_id)
                      left join " 
    TABLE_GEO_ZONES " tz on (tz.geo_zone_id = tr.tax_zone_id) )
                      where (za.zone_country_id is null
                      or za.zone_country_id = 0
                      or za.zone_country_id = '" 
    . (int)$country_id "')
                      and (za.zone_id is null
                      or za.zone_id = 0
                      or za.zone_id = '" 
    . (int)$zone_id "')
                      and tr.tax_class_id = '" 
    . (int)$class_id "'
                      group by tr.tax_priority"
    ;
    // KLUDGE START by Harmeet - To charge only GST from resellers.
    }
    // KLUDGE END 

    Close to line 78, look for -

    PHP Code:
        if ($tax->RecordCount() > 0) {
          
    $tax_description '';
          while (!
    $tax->EOF) {
            
    $tax_description .= $tax->fields['tax_description'] . ' + ';
            
    $tax->MoveNext();
          }
          
    $tax_description substr($tax_description0, -3);

          return 
    $tax_description;
        } else {
          return 
    TEXT_UNKNOWN_TAX_RATE;
        } 
    Replace it with -

    PHP Code:
    // KLUDGE START by Harmeet - To charge only GST from resellers.
      
    if ($_SESSION['customer_id']) {
        
    $customers_id $_SESSION['customer_id'];
        
    $customer_check $db->Execute("select * from " TABLE_CUSTOMERS " where customers_id = '$customers_id'");
        if (
    $customer_check->fields['customers_whole'] != "0") {
            
    $whole 1;
        }
      }
      if (
    $whole) {
        if (
    $tax->RecordCount() > 0) {
          
    $tax_description $tax->fields['tax_description'] . ' + ';
          
    $tax_description substr($tax_description0, -3);
          return 
    $tax_description;
        } else {
          return 
    TEXT_UNKNOWN_TAX_RATE;
        }
      }
      else {
    // KLUDGE END
        
    if ($tax->RecordCount() > 0) {
          
    $tax_description '';
          while (!
    $tax->EOF) {
            
    $tax_description .= $tax->fields['tax_description'] . ' + ';
            
    $tax->MoveNext();
          }
          
    $tax_description substr($tax_description0, -3);

          return 
    $tax_description;
        } else {
          return 
    TEXT_UNKNOWN_TAX_RATE;
        }
    // KLUDGE START by Harmeet - To charge only GST from resellers.
      
    }
    // KLUDGE END 
    Hope it works for you.

    Thanks
    Last edited by harmeet; 13 Aug 2006 at 10:19 PM.

  6. #6
    Join Date
    May 2006
    Posts
    30
    Plugin Contributions
    0

    Default Re: Charge only one tax from resellers

    Here is the link to the Dual Pricing module -

    http://www.zen-cart.com/forum/showthread.php?t=35450

    Thanks

  7. #7
    Join Date
    Jan 2006
    Posts
    13
    Plugin Contributions
    0

    Default Re: Charge only one tax from resellers

    That is awesome, I will tackle that one soon!
    Thanks for replying

  8. #8
    Join Date
    Jun 2006
    Posts
    566
    Plugin Contributions
    0

    Default Re: Charge only one tax from resellers

    sweet this must be the answer i have been looking for?

  9. #9
    Join Date
    Dec 2006
    Posts
    5
    Plugin Contributions
    0

    Default Re: Charge only one tax from resellers

    Now it seems that Zen Cart has some code that apparently works for wholesalers (Thanks Harmeet!), I'm going to seriously test how well this works for my needs. However, there is another download (Tax Exemption Status) that seems to be similar to the the modifed Dual Pricing module.

    Has anyone set up a store for both retail and wholesale customers so that wholesale customers are exempt from paying provincial retail sales tax (in Canada)?

  10. #10
    Join Date
    Dec 2006
    Posts
    5
    Plugin Contributions
    0

    Default Setting Up a Wholesale & Retail Store

    I see that the Dual Pricing - Wholesale Pricing download (modified with Harmeet's changes) allows a customer to be set up as a wholesale customer who is tax-exempt. However, the Tax Exemption Status download seems to do something similar.

    I would like to set my store up as follows:
    • retail prices shown to the general public.
    • wholesale prices shown only to wholesale customers once they have logged-in.
    • wholesale customers are exempt from paying provincial retail sales tax once they provide their tax exemption number.
    • quantity-based discounts for wholesale customers and possibly also for retail customers.
    What would be the best way to accomplish this?

    Frank
    Last edited by Kim; 20 Jan 2007 at 01:11 AM. Reason: Post moved. Please do not start a new thread. Thanks

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v151 I need to charge tax only in Colorado
    By brianw3185 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 14
    Last Post: 30 Sep 2013, 07:46 AM
  2. Workaround for Resellers/Tax Exempt
    By sarahbn in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 5
    Last Post: 26 Jun 2009, 08:13 PM
  3. Only charge tax to people from the same state
    By susanshropshire in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 17 May 2009, 08:39 PM
  4. how do i charge just one flat tax rate
    By rohitsax in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 8
    Last Post: 6 Nov 2007, 04:30 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