move changeLanguage to oxcmp_lang because of seldom language errors while query generating

This commit is contained in:
Daniel Seifert 2017-03-03 07:55:15 +00:00
parent 60bfcad932
commit d452e6ba8e
5 changed files with 22 additions and 1 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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();

View File

@ -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(

View File

@ -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
) {

View File

@ -0,0 +1,17 @@
<?php
class d3_oxcmp_lang_geoip extends d3_oxcmp_lang_geoip_parent
{
private $_sModId = 'd3_geoip';
public function init()
{
if (d3_cfg_mod::get($this->_sModId)->isActive()) {
/** @var $oLocation d3geoip */
$oLocation = oxNew('d3geoip');
$oLocation->setCountryLanguage();
}
parent::init();
}
}