RE: Local, City, County Sales Tax and Taxes
ocularmagic <[email protected]>
| Newsgroups | gmane.comp.web.oscommerce.features |
|---|---|
| Message-ID | <b41c949a15cc9a99c7706932b85a5e5a@osCommerce-Forums> |
This message was sent from: Features
http://forums.oscommerce.com/viewtopic.php?p=163072#163072
----------------------------------------------------------------
You know what, I never even noticed that the state field is empty. I wonder what it's there for then? Anyway, it doesn't really matter as you can get the state of the customer by checking their entry_zone_id in the address book table against the zone_id in the zones table and then get the state that way. For example the entry_zone_id is 13, so you go to the zones table and look up the zone_id that is equal to 13, then pull out the name. Well I guess you don't even have to do that much if you are going to hard code it. Just pull out the entry_zone_id along with entry_city then just check if it's 13 when you check the city. If it is, then it's in Colorado. So your code changes would look like the following:
For the query you just add entry_zone_id.
[code]
$customer_city_query = tep_db_query("select entry_city, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");[/code]
And for the if statements you add the theck for it also.
[code]
if (($customer_city['entry_city'] == 'Denver') && ($customer_city['entry_zone_id] == 13)) {
[/code]
That should be it, then it will only enter the ifs for Denver Colorado. Let me know if this works out. Check to see what your zone_id is for Colorado, it was 13 in my db. You should really not have all those ifs because you want every case. Who knows if someone will come along and accidentallly have their caps lock on for the first half of DENver and figure that your cart will fix it. It would just be a simple function call and it would eliminate a lot of bloated code. I'm sure I'll run across it and I'll post it here when I do. This should work for now though. Glad I could help.