humbert Posted August 18, 2022 Share Posted August 18, 2022 (edited) Purpose: to show prices with tax for people from a certain country without logging and registering. Version PrestaShop 1.5.6. File: config.inc.php Search string $defaultCountry = new Country(Configuration::get('PS_COUNTRY_DEFAULT'), Configuration::get('PS_LANG_DEFAULT')); Replace to: $country_user=geoip_country_code_by_name($_SERVER['REMOTE_ADDR']); //Getting the country code by IP if($country_user=="IL") //country Israel { $defaultCountry = new Country(29, Configuration::get('PS_LANG_DEFAULT')); // 29 - Country number in the database PrestaShop } else { $defaultCountry = new Country(Configuration::get('PS_COUNTRY_DEFAULT'), Configuration::get('PS_LANG_DEFAULT')); } Edited August 18, 2022 by humbert (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now