MLu Posted October 1, 2008 Posted October 1, 2008 I have visitors from for example Germany, Austria and Switzerland. German visitors would typically have browser language "de" or "de-de" whereas Austrians would have "de-at" and Swizz customers for example "ch-de", "ch-fr" or "ch-it". In my shop I have languages for German, Italian and French, and the language side seems to work o.k., but how to present customers with the correct Tax? Germans pay another tax rate than Austrians, and Swizz customers do not pay tax at all due to being outside EU. A solution could be - I guess - to build a switch case pre-allocating a country before the customer logs in, so "de*" should be treated as belonging to country Germany, "ch*" as Switzerland etc. But how where could this be done? Guess I should do it somewhere in general.php or application_top.php, but hope for some hints :)
♥geoffreywalton Posted October 1, 2008 Posted October 1, 2008 OSC should charge tax on the country of the shipping address. Set your tax zones/rates in your shop admin accordingly. Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>.
MLu Posted October 1, 2008 Author Posted October 1, 2008 OSC should charge tax on the country of the shipping address. Set your tax zones/rates in your shop admin accordingly. Thanks Geoffrey. This I know of course, but the problem is that I - and OsCommerce - do not know the customers country before the customer registers/log in. Therefore I would like to let OsCommerce base the display of prices and language on the customers preferred browser language, for example so that a customer with "de-at" is presented with German language and Austria as Tax Zone, and a "it-ch" customer is presented with Italian language and the tax zone of Switzerland. Just don't know how to do this from a programmatical point of view :(
♥geoffreywalton Posted October 1, 2008 Posted October 1, 2008 OSC will initially display in the language of the browser being used to view the site. Never used a inc tax version so will watch this thread with interest Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>.
MLu Posted October 24, 2008 Author Posted October 24, 2008 I finally manged to get this to work, so based on the browser language code, for example 'de-at" I display the site in German language and sets the country to Austria. This way the customer gets prices with the correct tax applied - Hurra!! BUT, for some strange reason when the customer actually logs in, the VAT is excluded from the shopping basket :-( Eventually the price becomes right in the order confirmation screen (which includes the correct tax), but this is exactly something that annoys and frustrates customers. How can I avoid that tax is being removed from the basket value? I have made the above modification by implementing a function in general.php this way: function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) { global $customer_zone_id, $customer_country_id; if ( ($country_id == -1) && ($zone_id == -1) ) { if (!tep_session_is_registered('customer_id')) { $country_id = tep_get_country_by_language(getenv('HTTP_ACCEPT_LANGUAGE'), true); $zone_id = '0'; } else { $country_id = $customer_country_id; $zone_id = $customer_zone_id; } } So rather than using $country_id = default_country; I use: $country_id = tep_get_country_by_language(getenv('HTTP_ACCEPT_LANGUAGE'), true); Do I need to make some modifications also somewhere to control the calculation in the shopping basket? Thanks!!
MLu Posted October 24, 2008 Author Posted October 24, 2008 Should mention that the problem with the sudden missing tax on the shopping basket only seems to be relevant when/if the customers changes country via the address book. But strange anyway that this action leads to that the tax completely disappears from the shopping basket then.
Amadeuss Posted December 1, 2008 Posted December 1, 2008 I was actually looking for the same thing. ur code doesn't work for me though... Any more ideas? From what I understand ... Germany wants the product prices shown with VAT while Switzerland don't. So I need to show the prices depending on the language selected by user. Thank you in advance!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.