Washington State Destination Sales Tax API
They are calling it the "WA Sales Tax Rate Lookup URL Interface", here is a link http://dor.wa.gov/Content/FindTaxesAndRates/RetailSalesTax/DestinationBased/ClientInterface.aspx
The osCommerce folks seem to have something in the works already, starting with post #57 in this thread forums.oscommerce.com/index.php?showtopic=292985&st=56
Hopefully someone with programming skills can do something with this info......
Jim
Re: Washington State Destination Sales Tax API
Quote:
Originally Posted by
maitaijim
Would it be too hard to see if this can be adapted to Zen-Cart?
*I have only sold one item in my own home state of Washington since March... so I guess it isn't a huge deal for me. But still... I would like to be legit. (I will keep my eyes out for a Zen-Cart version of this WA state destination based sales tax module.
Re: Washington State Destination Sales Tax API
It looks like a guy named lildog (Todd) with help from others has completed the osCommerce one: http://forums.oscommerce.com/index.p...=292985&st=180
I wonder if we can get him to build one for Zen-Cart? WA will allow us to spend up to $1000 on the software to get the new Destination Sales Tax to work on our sites.
Maybe we can pay lildog off?
What do you think?
Re: Washington State Destination Sales Tax API
oops... didn't mean to make the link to the other shopping cart a "live" link. Need to strip off the http://.
Re: Washington State Destination Sales Tax API
I just PMed the guy over there to see if he knows what kid of Mods we would ned to make to have it work with our Zen-Carts
Re: Washington State Destination Sales Tax API
I did a bit of work on this problem using the WA sales tax online lookup service and a script called WAStateRateParser.inc.php file from:
http://www.destinationtax.com/washin...tax-lookup.htm
My small contribution is able to accept an address and return the tax rate from WA.
What we need is someone more familiar with zen-cart who can fill in the two bits of unknown information for me. 1. the variable that has the shipping address, and 2. the variable that has zen-cart's tax rate that we can overwrite.
WAStateRateParser.inc.php can be downloaded at the link above.
My contribution is below:
PHP Code:
<?php
// $override_tax_rate is used incase there are any problems connecting to or with the results returned from dor.wa.gov. (value is percent expressed as a decimle 9% = .09)
$override_tax_rate = ".09";
// when set to true only the debug settings below will be used (for testing)
$wa_tax_debug_mode = "true";
// ########## DEBUG SETTINGS ##########
$wa_tax_debug_address = "6500 Linderson way"; // example address
$wa_tax_debug_city = ""; // example city
$wa_tax_debug_zip = "98501"; // example zip 5 or 9 digit is OK
include_once('WAStateRateParser.inc.php'); // Include code from http://www.destinationtax.com/washington-state-destination-tax-lookup.htm by Jerry Higbee
if($wa_tax_debug_mode) { // If in debug mode use example address
$wa_tax_address = $wa_tax_debug_address;
$wa_tax_city = $wa_tax_debug_city;
$wa_tax_zip = $wa_tax_debug_zip;
} else { // !!! This needs to be changed to pass the variables from zen-cart's shipping address !!!
$wa_tax_address = $wa_tax_debug_address;
$wa_tax_city = $wa_tax_debug_city;
$wa_tax_zip = $wa_tax_debug_zip;
}
// Lookup the address
$rate_look = new WAXMLParser($wa_tax_address,$wa_tax_city,$wa_tax_zip);
$rate_look->setSimpleXML();
$my_lookup = $rate_look->getParsedData();
// Get Local, State, and Total tax
$wa_local_tax_rate = floatval($my_lookup['localrate']);
$wa_state_tax_rate = floatval($my_lookup['staterate']);
$wa_tax_rate = ($wa_local_tax_rate + $wa_state_tax_rate);
// check for valid tax rates otherwise go with the highest default rate
$wa_tax_error = 0;
if ($wa_local_tax_rate < 1 && $wa_local_tax_rate > .01) { } else { $wa_tax_error++; }
if ($wa_state_tax_rate < 1 && $wa_state_tax_rate > .06) { } else { $wa_tax_error++; }
if ($wa_tax_error > 0 ) {
$wa_tax_rate = $override_tax_rate;
}
// if in debug mode display returned tax rates for the address given
if($wa_tax_debug_mode) {
echo "WA Tax Rate: <strong>$wa_tax_rate</strong><br>Local Tax Rate: $wa_local_tax_rate<br>State Tax Rate: $wa_state_tax_rate<br><br>";
if ($wa_tax_error > 0 ) { echo "<br>There were errors with the returned tax rates. Default tax rate of $override_tax_rate was used instead.<br>"; }
print_r($my_lookup);
}
// Pass WA tax rate back to zen-cart replacing default tax rate
$unknown_zen_cart_tax_variable = $wa_tax_rate; // !!! This needs to be changed
?>
Re: Washington State Destination Sales Tax API
OK, I contacted Jerry who wrote the standalone PHP WA tax lookup
http://www.destinationtax.com/washin...tax-lookup.htm
He is looking into integrating the solution into zen-cart. No price on his services yet, but if anyone else would be willing to pay for the module chime in.
Thanks!
Re: Washington State Destination Sales Tax API
.. Or we can follow these directions and port the osCommerce one to Zen-Cart's: http://www.zen-cart.com/wiki/index.p...dules_from_osC
"Many contributions for osCommerce have been ported to Zen Cart™. There are a few general rules for converting osCommerce code to Zen Cart™ v1.2.x or v1.3.x code. "
Re: Washington State Destination Sales Tax API
OK I too live in Washington State and am interested in getting this set up. Am looking for a definite fix or mod to do this. I do not want to modify my carts until specific instructions or a definite mod is available to do this. Thank you all for working on it. Keep us Washington residents informed please. This type of tax system will probably be coming to YOUR hometown soon!:smile:
Re: Washington State Destination Sales Tax API
We're working on this for a number of Zen Cart builds right now. We've done 2 Virtuemart & a CREloaded versions so far and have some Zen versions completed that are just not public yet.
You can see our methodology we're following for Washington State Destination Sales Tax here. If you can think of an easier way to get the zip + 4 from a user who doesn't know it ahead of time (like every customer in existence) we're all ears.
USPS wanted $3,000 for access to their real time API when we called ... so we went with Yahoo Maps to look-up the +4.
I guess merchants who got on a pilot program got a B & O tax credit towards their implementation of this if they were done prior to June 30th or so.
We'll post the Zen Examples as soon as they are up. The two we just completed have not launched their sites yet.. otherwise I'd show you how it looks.
Tom