MLu Posted December 19, 2004 Share Posted December 19, 2004 I have tried to include a switch/case in /includes/functions/general.php, with the intention to set $country_id and $zone_id based on the language selected by the visitor. The code example below is only test data, but I do not understand why it always selects the "default" value despite of the visitors choice. Is general.php only executed at startup, so that any subsequent changes in $HTTP_GET_VARS['language']) does not reflect, or ??? Any help would be greatly appreciated. Mogens // Returns the tax rate for a zone / class // TABLES: tax_rates, zones_to_geo_zones 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')) { // Old code shown below // $country_id = STORE_COUNTRY; // $zone_id = STORE_ZONE; // End of old code // My modified code shown below switch ($HTTP_GET_VARS['language']) { case 'da': $country_id = '57'; $zone_id = '0'; break; case 'sv': $country_id = '203'; $zone_id = '0'; break; default: $country_id = '81'; $zone_id = '0'; break; // End of my modified code } } else { $country_id = $customer_country_id; $zone_id = $customer_zone_id; } } :'( Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.