diff --git a/.gitattributes b/.gitattributes index 73b98c1..bf1e33e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,6 +11,7 @@ copy_this/modules/d3/d3geoip/controllers/admin/d3_country_geoip.php -text copy_this/modules/d3/d3geoip/menu.xml -text copy_this/modules/d3/d3geoip/metadata.php -text copy_this/modules/d3/d3geoip/models/d3geoip.php -text +copy_this/modules/d3/d3geoip/modules/components/d3_oxcmp_lang_geoip.php -text copy_this/modules/d3/d3geoip/modules/controllers/d3_oxshopcontrol_geoip.php -text copy_this/modules/d3/d3geoip/picture.png -text copy_this/modules/d3/d3geoip/setup/d3geoip_update.php -text diff --git a/copy_this/modules/d3/d3geoip/components/d3cmp_geoip.php b/copy_this/modules/d3/d3geoip/components/d3cmp_geoip.php index 8148e78..b9f0d2a 100644 --- a/copy_this/modules/d3/d3geoip/components/d3cmp_geoip.php +++ b/copy_this/modules/d3/d3geoip/components/d3cmp_geoip.php @@ -37,7 +37,8 @@ class d3cmp_geoip extends oxView /** @var $oLocation d3geoip */ $oLocation = oxNew('d3geoip'); $oLocation->setCountryCurrency(); - $oLocation->setCountryLanguage(); + // moved to oxcmp_lang extension because here it's to late + // $oLocation->setCountryLanguage(); if (!isset($oBasket)) { $oBasket = $this->getSession()->getBasket(); diff --git a/copy_this/modules/d3/d3geoip/metadata.php b/copy_this/modules/d3/d3geoip/metadata.php index b904507..326978a 100644 --- a/copy_this/modules/d3/d3geoip/metadata.php +++ b/copy_this/modules/d3/d3geoip/metadata.php @@ -20,6 +20,7 @@ $aModule = array( 'email' => 'support@shopmodule.com', 'url' => 'http://www.oxidmodule.com/', 'extend' => array( + 'oxcmp_lang' => 'd3/d3geoip/modules/components/d3_oxcmp_lang_geoip', 'oxshopcontrol' => 'd3/d3geoip/modules/controllers/d3_oxshopcontrol_geoip', ), 'files' => array( diff --git a/copy_this/modules/d3/d3geoip/models/d3geoip.php b/copy_this/modules/d3/d3geoip/models/d3geoip.php index 1f78dc3..958cf6f 100644 --- a/copy_this/modules/d3/d3geoip/models/d3geoip.php +++ b/copy_this/modules/d3/d3geoip/models/d3geoip.php @@ -250,6 +250,7 @@ class d3GeoIP extends oxBase if (!$this->isAdmin() && oxRegistry::getUtils()->isSearchEngine() === false + && oxRegistry::getSession()->getId() && oxRegistry::getSession()->getVariable('d3isSetLang') === null && $oCountry->getId() && $oCountry->getFieldData('d3geoiplang') > -1 ) { diff --git a/copy_this/modules/d3/d3geoip/modules/components/d3_oxcmp_lang_geoip.php b/copy_this/modules/d3/d3geoip/modules/components/d3_oxcmp_lang_geoip.php new file mode 100644 index 0000000..6793c39 --- /dev/null +++ b/copy_this/modules/d3/d3geoip/modules/components/d3_oxcmp_lang_geoip.php @@ -0,0 +1,17 @@ +_sModId)->isActive()) { + /** @var $oLocation d3geoip */ + $oLocation = oxNew('d3geoip'); + $oLocation->setCountryLanguage(); + } + + parent::init(); + } +} \ No newline at end of file