Page 60 of 64 FirstFirst ... 10505859606162 ... LastLast
Results 591 to 600 of 635
  1. #591
    Join Date
    Jun 2012
    Location
    Florida
    Posts
    123
    Plugin Contributions
    5

    Default Re: Local Sales Tax Mod - Support Thread

    Quote Originally Posted by batracy View Post
    Since there doesn't seem to be any support happening here, I've taken matters into my own hands (a dangerous thing) and hacked three files to support a rather odd but usable method to deal with handling local taxes using the existing "built-in" tax module. If anyone is interested in what I did, send me a message and I'll try to explain it.
    Hi,
    It has been a long time since I have had to look at this mod since it seems to be working for my needs.
    To try and help, I have created a GitHub repository for this code and related issues to be worked when needed.

    Anyone is welcome to work on it, and to contribute "Issues".

    If you would like to share your recent changes "hacks" that would be great, you could post them to the Issues page of the repository.
    Maybe we can use your change to create better module for all and post the update to the Plugins area.

    Thanks.
    Backup Files and Databases First. GitHub
    Suggestions, Plugins, etc. used at your own risk.

  2. #592
    Join Date
    Jun 2012
    Posts
    57
    Plugin Contributions
    2

    Default Re: Local Sales Tax Mod - Support Thread

    Since the changes I made are not on or a part of this plug-in, but rather on the built-in tax module I thought I would just share what I did here.

    Background: My store is located in the state of Colorado, United States. Further, it is located in the city of Loveland, within Larimer county. I am required to collect sales tax at the state level for anyone living within the state of Colorado, at the county level for those within Larimer county, and at the city level for those within Loveland.

    Step 1: Define zones (yes, zones - not zone defines) for each of the zip-codes within Larimer county. These are defined as Country = United States, Zone Name = Colorado, 80537, Zone Code = CO. For my needs, this meant defining 24 new zones (one for each of the zip-codes)

    Step 2: Define zone definitions - one for the State, one for the County, and one for the City

    Step 3: For each of the new zone definitions, go to details and add each zone as appropriate. Note, state should be normal state zone, county includes all zip-code zones for the county except those for the city, and city gets those for the city.

    Step 4: Create the appropriate Tax rates for each of State, County, and City.

    Step 5: Add the following defines to your english.php file - found in your override folder
    Code:
    // defines to setup local taxes
      define('US_HOME_STATE_ID', '13'); // this is the zone_id from the database for Colorado
      define('US_HOME_STATE_NAME', 'Colorado');
    Step 6: Modify the code in the following three files:
    includes/modules/checkout_new_address.php
    includes/modules/create_account.php
    includes/modules/pages/address_book_process/header_php.php

    The modification is the same in all three files:

    Find the following code...
    Code:
      if (ACCOUNT_STATE == 'true') {
        $state = (isset($_POST['state'])) ? zen_db_prepare_input($_POST['state']) : FALSE;
        if (isset($_POST['zone_id'])) {
          $zone_id = zen_db_prepare_input($_POST['zone_id']);
        } else {
          $zone_id = false;
        }
      }
    and change it to...
    Code:
        if (ACCOUNT_STATE == 'true') {
          $state = zen_db_prepare_input($_POST['state']);
          if (isset($_POST['zone_id'])) {
            $zone_id = zen_db_prepare_input($_POST['zone_id']);
    // add hack to set up "state, zip" check for Colorado      
          if ($zone_id == US_HOME_STATE_ID) {
            $state = US_HOME_STATE_NAME . ", " . substr($postcode, 0, 5);   // format is now "Colorado, 80537"
            $temp_zone_id = $zone_id;  // saving this for test later if new format is not found
            $zone_id = false;  // have to do this or the db select will fail = disaster
          } else {
            $temp_zone_id = false;  // make sure this is false if we are not dealing with our home state
          }
    // end hack      
          } else {
            $zone_id = false;
          }
        }
    Also find the following code ...
    Code:
          if ($found_exact_iso_match) {
            $zone_id = $zone->fields['zone_id'];
            $zone_name = $zone->fields['zone_name'];
          } else {
            $error = true;
            $error_state_input = true;
            $messageStack->add('addressbook', ENTRY_STATE_ERROR_SELECT);
          }
    and change it to ...
    Code:
          if ($found_exact_iso_match) {
            $zone_id = $zone->fields['zone_id'];
            $zone_name = $zone->fields['zone_name'];
    //added hack to reset zone_id if "state, zip" combination was not found        
          } elseif ($temp_zone_id) {	
            $zone_id = $temp_zone_id;
            $zone_name = US_HOME_STATE_NAME;		
    // end hack        
          } else {
            $error = true;
            $error_state_input = true;
            $messageStack->add('checkout_address', ENTRY_STATE_ERROR_SELECT);
          }
    Note the changes I made are wrapped in "hack" comments

    That's it. When a customer sets up their address and selects their state, and enters their zip code, the code changes ensure that the correct zone is selected for the state, zip combination. If you configure your tax and zones correctly, the built-in tax module will charge the correct amount of tax, and will recalculate the correct amount of tax when a coupon or gift voucher is used.

    Note: two of the files can be modified in overrides, the the one in the pages folder cannot.

    MODIFY FILES AT YOUR OWN RISK - this hack is not supported.

  3. #593
    Join Date
    Jun 2012
    Location
    Florida
    Posts
    123
    Plugin Contributions
    5

    Default Re: Local Sales Tax Mod - Support Thread

    Thank you for sharing this.
    Backup Files and Databases First. GitHub
    Suggestions, Plugins, etc. used at your own risk.

  4. #594
    Join Date
    Dec 2006
    Location
    Hudson Valley, New York USA
    Posts
    93
    Plugin Contributions
    0

    Default Re: Local Sales Tax Mod - Support Thread

    Thanks for providing this information batracy. I have a question, because I'm in New York. We're required to collect tax for anyone in New York, however the tax rate varies based on County (there is no city tax). Currently, using the Local Sales Tax mod, the mod calculates 4% sales tax for anyone in NY and adds whatever County tax on top of that, but as many have noted it does not work properly with Coupons or Gift Vouchers. It calculates the tax on the full amount and ignores any discount from a coupon or gift certificate.

    Using your method, how would I set up my tax zones? Would I have to create a Zone for each NY County zip code (There are currently 2234 zip codes used in the Local Sales Tax mod for NY)? I imagine I could write an SQL to do such a thing, but wanted to make sure I'm understanding your method correctly.

    Quote Originally Posted by batracy View Post
    Since the changes I made are not on or a part of this plug-in, but rather on the built-in tax module I thought I would just share what I did here.

    Background: My store is located in the state of Colorado, United States. Further, it is located in the city of Loveland, within Larimer county. I am required to collect sales tax at the state level for anyone living within the state of Colorado, at the county level for those within Larimer county, and at the city level for those within Loveland.

    Step 1: Define zones (yes, zones - not zone defines) for each of the zip-codes within Larimer county. These are defined as Country = United States, Zone Name = Colorado, 80537, Zone Code = CO. For my needs, this meant defining 24 new zones (one for each of the zip-codes)

    Step 2: Define zone definitions - one for the State, one for the County, and one for the City

    Step 3: For each of the new zone definitions, go to details and add each zone as appropriate. Note, state should be normal state zone, county includes all zip-code zones for the county except those for the city, and city gets those for the city.

    Step 4: Create the appropriate Tax rates for each of State, County, and City.

    Step 5: Add the following defines to your english.php file - found in your override folder
    Code:
    // defines to setup local taxes
      define('US_HOME_STATE_ID', '13'); // this is the zone_id from the database for Colorado
      define('US_HOME_STATE_NAME', 'Colorado');
    Step 6: Modify the code in the following three files:
    includes/modules/checkout_new_address.php
    includes/modules/create_account.php
    includes/modules/pages/address_book_process/header_php.php

    The modification is the same in all three files:

    Find the following code...
    Code:
      if (ACCOUNT_STATE == 'true') {
        $state = (isset($_POST['state'])) ? zen_db_prepare_input($_POST['state']) : FALSE;
        if (isset($_POST['zone_id'])) {
          $zone_id = zen_db_prepare_input($_POST['zone_id']);
        } else {
          $zone_id = false;
        }
      }
    and change it to...
    Code:
        if (ACCOUNT_STATE == 'true') {
          $state = zen_db_prepare_input($_POST['state']);
          if (isset($_POST['zone_id'])) {
            $zone_id = zen_db_prepare_input($_POST['zone_id']);
    // add hack to set up "state, zip" check for Colorado      
          if ($zone_id == US_HOME_STATE_ID) {
            $state = US_HOME_STATE_NAME . ", " . substr($postcode, 0, 5);   // format is now "Colorado, 80537"
            $temp_zone_id = $zone_id;  // saving this for test later if new format is not found
            $zone_id = false;  // have to do this or the db select will fail = disaster
          } else {
            $temp_zone_id = false;  // make sure this is false if we are not dealing with our home state
          }
    // end hack      
          } else {
            $zone_id = false;
          }
        }
    Also find the following code ...
    Code:
          if ($found_exact_iso_match) {
            $zone_id = $zone->fields['zone_id'];
            $zone_name = $zone->fields['zone_name'];
          } else {
            $error = true;
            $error_state_input = true;
            $messageStack->add('addressbook', ENTRY_STATE_ERROR_SELECT);
          }
    and change it to ...
    Code:
          if ($found_exact_iso_match) {
            $zone_id = $zone->fields['zone_id'];
            $zone_name = $zone->fields['zone_name'];
    //added hack to reset zone_id if "state, zip" combination was not found        
          } elseif ($temp_zone_id) {    
            $zone_id = $temp_zone_id;
            $zone_name = US_HOME_STATE_NAME;        
    // end hack        
          } else {
            $error = true;
            $error_state_input = true;
            $messageStack->add('checkout_address', ENTRY_STATE_ERROR_SELECT);
          }
    Note the changes I made are wrapped in "hack" comments

    That's it. When a customer sets up their address and selects their state, and enters their zip code, the code changes ensure that the correct zone is selected for the state, zip combination. If you configure your tax and zones correctly, the built-in tax module will charge the correct amount of tax, and will recalculate the correct amount of tax when a coupon or gift voucher is used.

    Note: two of the files can be modified in overrides, the the one in the pages folder cannot.

    MODIFY FILES AT YOUR OWN RISK - this hack is not supported.

  5. #595
    Join Date
    Jun 2012
    Posts
    57
    Plugin Contributions
    2

    Default Re: Local Sales Tax Mod - Support Thread

    Quote Originally Posted by gwynwyffar View Post
    Thanks for providing this information batracy. I have a question, because I'm in New York. We're required to collect tax for anyone in New York, however the tax rate varies based on County (there is no city tax). Currently, using the Local Sales Tax mod, the mod calculates 4% sales tax for anyone in NY and adds whatever County tax on top of that, but as many have noted it does not work properly with Coupons or Gift Vouchers. It calculates the tax on the full amount and ignores any discount from a coupon or gift certificate.

    Using your method, how would I set up my tax zones? Would I have to create a Zone for each NY County zip code (There are currently 2234 zip codes used in the Local Sales Tax mod for NY)? I imagine I could write an SQL to do such a thing, but wanted to make sure I'm understanding your method correctly.
    Yes, you are understanding this correctly and would need to setup all 2234 zip codes in order to define each of the county taxing entities. This method is not perfect because of the amount of work to set it up (and maintain should the zip codes change), and the fact that all the zip codes show up in the state dropdown box, but it does work. I have it setup now for both of my stores.

  6. #596
    Join Date
    Jun 2012
    Posts
    57
    Plugin Contributions
    2

    Default Re: Local Sales Tax Mod - Support Thread

    Also forgot to mention, change the define statements in the english.php file to your state (you will have to look up the zone_id for your state from the database). Also, be aware that if you are not using the dropdown box for the state selection this method of getting the correct state, zip combination does not work, and would require some code changes.

  7. #597
    Join Date
    Dec 2006
    Location
    Hudson Valley, New York USA
    Posts
    93
    Plugin Contributions
    0

    Default Re: Local Sales Tax Mod - Support Thread

    I think I'll wait until someone updates this mod as it is. Having 2000+ NY zip codes show in the dropdown for someone checking out is completely impractical for our store as we do a very small percentage of our business in our own state. Thank you for providing the information for this option, though!

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

    Default Re: Local Sales Tax Mod - Support Thread

    The new store pickup mod (updated as of 1.5.4) does not work with local sales taxes any longer.
    The full-time Zen Cart Guru. WizTech4ZC.com

  9. #599
    Join Date
    Dec 2010
    Location
    Seattle
    Posts
    83
    Plugin Contributions
    1

    Default Re: Local Sales Tax Mod - Support Thread

    I know it has been mentioned before in this thread, but have you tried the TaxCloud module? https://GitHub.com/TaxCloud/ZenCart

  10. #600
    Join Date
    Dec 2006
    Location
    Hudson Valley, New York USA
    Posts
    93
    Plugin Contributions
    0

    Default Re: Local Sales Tax Mod - Support Thread

    Based on the TaxCloud forum thread, it appears that the current plugin version of TaxCloud here on Zen-Cart.com is not fully compatible with version 1.5.4. I'd be happy to use it if it were.

 

 
Page 60 of 64 FirstFirst ... 10505859606162 ... LastLast

Similar Threads

  1. v151 Tax getting added twice after installing Local Sales Tax mod
    By RFree190 in forum General Questions
    Replies: 0
    Last Post: 19 Mar 2013, 05:10 AM
  2. v150 Problem with Local Sales Tax mod
    By pwithers in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 18 Jun 2012, 10:16 PM
  3. local sales tax mod not working
    By sharpie82 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 12 Dec 2011, 11:43 AM
  4. New York State Sales Tax by Zip Full Database for Local Sales Tax Mod 2011
    By SCHNiKEN in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 11 Apr 2011, 04:51 AM
  5. Local Sales Tax Mod and Reward Points Mod
    By retched in forum Addon Payment Modules
    Replies: 1
    Last Post: 9 Feb 2011, 02:09 AM

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