Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Posts
    3
    Plugin Contributions
    0

    Default Calculating County taxes

    Disclaimer: I've searched the site and found similar, but not exact, situations, so I thought I'd ask for myself.

    I live in a state (Wisconsin) where tax is calculated by county. Not zip code, not city, but COUNTY. I found a bunch of addons and general "whatnot" to calculate taxes based on city, zip code, or whatever else - which, as I said, does me little to no good. So, after some deep internet searching, I found some code:
    Code:
    //put the delivery address together for Google's URL
    $street = $order->delivery['address'];
    $city = $order->delivery['city'];
    $state = $order->delivery['state'];
    $zip = $order->delivery['zip'];
    $mapaddress = urlencode("$street $city $state $zip");
    //Your Google Maps API key
    $key = "APIKEY";
    // Desired URL
    $address = "http://maps.google.com/maps/geo?q=$mapaddress&output=xml&key=$key";
    // Retrieve the URL contents
    $page = file_get_contents($address);
    // Parse the returned XML file
    $xml = new SimpleXMLElement($page);
    // Retrieve the desired XML node
    $county = trim($xml->Response->Placemark->AddressDetails->
    Country->AdministrativeArea->SubAdministrativeArea->
    SubAdministrativeAreaName);
    My questions are, first, if this is actually "recommended" or not, and if so, where does it go? Thanks!

  2. #2
    Join Date
    Sep 2009
    Posts
    3
    Plugin Contributions
    0

    Default Re: Calculating County taxes

    Any ideas at all?

  3. #3
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Calculating County taxes


  4. #4
    Join Date
    Sep 2009
    Posts
    3
    Plugin Contributions
    0

    Default Re: Calculating County taxes

    Thanks, but that doesn't really solve what I was looking for. I'm (hoping) to find something that can be semi-transparent so that when a user has absolutely no idea which county to choose (out-of-towner ordering something for in-state delivery for example), that's already solved.

    Oh well, I'll keep looking...

 

 

Similar Threads

  1. v154 County taxes - GA
    By germerican in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 11
    Last Post: 19 Jul 2016, 04:55 PM
  2. Taxes... How do I setup Florida county taxes?
    By Randall in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 4
    Last Post: 27 May 2010, 02:41 PM
  3. Florida County Taxes
    By Lawbird123 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 8
    Last Post: 19 Feb 2008, 12:55 AM

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