From a3bd5cd250324aabeecbb90534dd34145f470ad9 Mon Sep 17 00:00:00 2001 From: vSchoener Date: Thu, 5 Apr 2012 14:37:21 +0000 Subject: [PATCH] [-] INSTALLER : Active only the country selected by the merchant (#PI-69) git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14497 b9a71923-0436-4b27-9f14-aed3839534dd --- install-dev/models/install.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install-dev/models/install.php b/install-dev/models/install.php index 4d042b8ac..90177d89a 100644 --- a/install-dev/models/install.php +++ b/install-dev/models/install.php @@ -362,6 +362,7 @@ class InstallModelInstall extends InstallAbstractModel Context::getContext()->shop = new Shop(1); Configuration::loadConfiguration(); + $id_country = Country::getByIso($data['shop_country']); // Set default configuration Configuration::updateGlobalValue('PS_SHOP_DOMAIN', Tools::getHttpHost()); @@ -370,7 +371,7 @@ class InstallModelInstall extends InstallAbstractModel Configuration::updateGlobalValue('PS_LOCALE_LANGUAGE', $this->language->getLanguageIso()); Configuration::updateGlobalValue('PS_SHOP_NAME', $data['shop_name']); Configuration::updateGlobalValue('PS_SHOP_ACTIVITY', $data['shop_activity']); - Configuration::updateGlobalValue('PS_COUNTRY_DEFAULT', Country::getByIso($data['shop_country'])); + Configuration::updateGlobalValue('PS_COUNTRY_DEFAULT', $id_country); Configuration::updateGlobalValue('PS_LOCALE_COUNTRY', $data['shop_country']); Configuration::updateGlobalValue('PS_TIMEZONE', $data['shop_timezone']); Configuration::updateGlobalValue('PS_CONFIGURATION_AGREMENT', (int)$data['configuration_agrement']); @@ -394,6 +395,9 @@ class InstallModelInstall extends InstallAbstractModel Configuration::updateGlobalValue('SHOP_LOGO_HEIGHT', round($height)); } + // Active only the country selected by the merchant + Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'country SET active = 0 WHERE id_country != '.(int)$id_country); + // Set localization configuration $version = str_replace('.', '', _PS_VERSION_); $version = substr($version, 0, 2);