Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

What php file calculates tax based on shipping address


mvpdigital

Recommended Posts

Posted

I have been searching through code for days. And I am not looking for someone to fix my problem, just give me some direction on where to look.

 

I am trying to find the php file where tax decisions are made dependant on shipping address.

 

I've set my Ontario Canada PST (RST) tax zones, classes, rates properly.

 

8% is added to the product & shipping totals when both billing&delivery addresses are in Ontario... GOOD!

No tax is added to product or shipping when both billing&delivery addresses are outside Ontario...GOOD!

 

If I have a billing address in Ontario, but a delivery address outside Ontario, 8% is added to the product price... NOT good. There should be no tax added.

If I have a billing address outside Ontario, but a delivery address in Ontario, 8% is added only to the shipping price...NOT good. There should be tax on both.

 

So it seems to me that the Canada Post Shipping module is calling for the proper info.

 

But what file calculates the product taxes? It seems that it is calculating on the billing, and not the delivery address.

 

Any help would be greatly appreciated.

 

Thank you so much.

Posted

The taxable address association is made in catalog/includes/classes/order.php

 

Not sure if that's where your particular issue is but it's a start. Have you made any changes to it?

Posted

If there's nothing wrong there, then maybe look at how your customer addresses are being added to the address book tables. There's a number of things that could be the source of the issue.

Posted
The taxable address association is made in catalog/includes/classes/order.php

 

Not sure if that's where your particular issue is but it's a start. Have you made any changes to it?

 

Thanks for the quick reply. I just looked over my order.php file and don't see any issue there.

 

As a test, I just installed a new store and database. I set up an Ontario pst Zone and ran some tests with Ontario and British Columbia addresses. I have the exact same problem with it?! Could this be a bug?

Posted
The taxable address association is made in catalog/includes/classes/order.php

 

Not sure if that's where your particular issue is but it's a start. Have you made any changes to it?

 

Okay, osrry. Scratch my last message. I just re-checked my new test install of ASC and the tax IS being handled correctly.

 

So I think you are right in that it is something in the tables. Any idea of the best place to start there?

Posted
The taxable address association is made in catalog/includes/classes/order.php

 

Not sure if that's where your particular issue is but it's a start. Have you made any changes to it?

 

The only change in the code, that I can find is from the CCGV contrib:

 

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 = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'");

 

CCGV change:

$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 = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)(($this->content_type == 'virtual' || 'virtual_weight') ? $billto : $sendto) . "'"); // Edited for CCGV

 

Could this be a problem?

Posted
If there's nothing wrong there, then maybe look at how your customer addresses are being added to the address book tables. There's a number of things that could be the source of the issue.

 

Thank you so much for the lead. I just replaced the CCGV code with the stock OSC code and the tax works properly. So now I just ned to figure out how to impliment the CCGV code without breaking the tax...

Archived

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

×
×
  • Create New...