Re: Tax based on Store not working
Hi there. Did you ever get a reply (pm or otherwise?)
I just ran into the same problem, and I have apparently fixed it for my 1.3.6 setup. I'd like wilt or drbyte for example to pop in and check my logic before recommending my fix to you, but I will at least share my fix!
What I found was that the tax calculations are based on country and zone, as you probably know.
Also, if the customer is logged in, the values for the country and zone are taken from the primary address ('This address is also used as the base for product and service tax calculations.') and stored in your web session (in your database)
If the customer is not logged in, these values are taken from the store's settings. That seems well and good, but in the case of tax based on store, the values in the customer's session are not necessarily what you want the tax to be calculated on, and, if you don't have any other tax regimes set up, not even the wrong tax rate, but zero tax is applied.
What I have done is changed that part of the code that tests to see if we want to calculate the tax based on the store location, and at that point absolutely ensure that the values used to calculate the tax are those from the store, not from the customer's session, which may or may not be correct.
In \includes\functions\functions_taxes
Change
PHP Code:
if (STORE_PRODUCT_TAX_BASIS == 'Store') {
if ($zone_id != STORE_ZONE) return 0;
}
to
PHP Code:
if (STORE_PRODUCT_TAX_BASIS == 'Store') {
$country_id = STORE_COUNTRY;
$zone_id = STORE_ZONE;
// if ($zone_id != STORE_ZONE) return 0;
}
Let me know if that helps.
If anyone wants to say I've missed the point and this is a hack, please do so now as I want to go live with my store asap ... I still have one question - http://www.zen-cart.com/forum/showthread.php?t=52138
Cheers
bikemike
'If language is not used correctly, what is said is not what is meant. If what is said is not what is meant, what ought to be done remains undone' Kǒng fū zǐ
Bookmarks