Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

need taxing based on billing address, not shipping address


dms

Recommended Posts

Posted

osc currently applies taxes based on the shipto address, i want tax applied based on the customers billing or home address, not based on where they ship the product to. anyone know of a way to do this?

 

 

j

Posted

its a one line change in order.php

 

 

 

'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $shipping_address['entry_country_id'], $shipping_address['entry_zone_id']),

 

you will need to change $shipping_address vars to $customer_shipping vars. after some debugging, i got this to work.

 

 

j

  • 1 month later...
Posted

NO.

 

Do not do this. You are now totaly disregarding the whole reason for the new checkout procedure (ie. the Ship_to & Bill_to addresses).

 

Personally, I think osc needs to have this as the default.

 

So for you new to the topic:

 

on or about line 213 of catalog/includes/classes/order.php

 

you need to change both 'tax' => ... & 'tax_description' =>....

 

to be not $shipping_address but rather $billing_address

  • 2 months later...
Posted
osc currently applies taxes based on the shipto address

 

It does?? On my installation it's putting California sales tax onto every order, even orders outside of California. I'm trying to figure out how to fix it. Is the default for OSC to apply taxes only to the state the product is being shipped to? I wonder how I broke that.

 

- Cisco

Posted
osc currently applies taxes based on the shipto address

 

It does?? On my installation it's putting California sales tax onto every order, even orders outside of California. I'm trying to figure out how to fix it. Is the default for OSC to apply taxes only to the state the product is being shipped to? I wonder how I broke that.

 

- Cisco

 

Ah never mind, found how to fix it in another thread.

Posted

What do we have to change in the code or configuration to charge taxes based on billing address instead of shipping adddress? :?:

  • 2 months later...
Posted

Okay, here's the line you need to change in classes/order.php

 

Original Code (about line 213):

        $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . $customer_id . "' and ab.address_book_id = '" . [b]($this->content_type == 'virtual' ? $billto : $sendto)[/b] . "'");

 

Modified Code:

      $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . $customer_id . "' and ab.address_book_id = '" . [b]$billto [/b]. "'");

Posted

crap!! hit the wrong button and there's errors...

 

Original code:

      $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . $customer_id . "' and ab.address_book_id = '" . ($this->content_type == 'virtual' ? $billto : $sendto) . "'");

 

Modified Code:

        $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . $customer_id . "' and ab.address_book_id = '" . $billto . "'");

 

The change is at the end of the line. Somehow this was too easy... :wink:

 

Good luck!

 

-al

Posted

so how does oscommerce know which amount to tax? i.e. if i were to tax items shippined in California only, it would recognize which items were sent to California, and which were sent to other states, and calculate the tax accordingly? or if i wanted to charge tax to several states, how would i tell the program how much to charge for each area? thanks :)

Posted

should set up tax zones (or states) &

tax class (such as taxable goods) &

Tax rate

in admin>locations/taxes>

 

once set up, if the ship to state is defined in tax zones

for all items marked as taxable goods

the tax in tax rate is applied to the order

 

For California vendors this works great becuase sales tax needs to be applied based on first use. If my interpritation is correct, then all orders destined for california must pay sales tax. If order is destined out of state, then no sales tax applies.

Posted

You need to set up your tax zones so that OSC knows what tax rate to apply to items being shipped to other states.

 

There's a good write-up on taxes in the forums -- a lot of us Canadians have trouble due to Quebec's rather regressive taxation (provincial tax is charged on federal taxes!).

 

Do a search for "tax AND zone" (no quotes) and see what you get. Here's one link which might cover your question.

 

http://www.oscommerce.com/forums/viewtopic.php...hlight=tax+zone

 

Good luck!

 

-al

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...