Zen Cart Logo
Forums / Currencies & Sales Taxes, VAT, GST, etc. / Calculating County taxes

Calculating County taxes

Locked

Views: 1,543

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
3 Sep 2009, 7:57 PM
#1
kevgos avatar

kevgos

New Zenner

Join Date:
Sep 2009
Posts:
3
Plugin Contributions:
0

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: ```
//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!
7 Sep 2009, 8:32 PM
#2
kevgos avatar

kevgos

New Zenner

Join Date:
Sep 2009
Posts:
3
Plugin Contributions:
0

Re: Calculating County taxes

Any ideas at all? :blush:

11 Sep 2009, 7:16 AM
#4
kevgos avatar

kevgos

New Zenner

Join Date:
Sep 2009
Posts:
3
Plugin Contributions:
0

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...