Jump to content

Edit History

humbert

humbert

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'));
}	

 

humbert

humbert

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_tmp=="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'));
}	

 

humbert

humbert

Purpose: to show prices with tax for people from a certain country without logging in 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_tmp=="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'));
}	

 

×
×
  • Create New...