고객의 IP로 상점을 운영하고 싶습니다.Magento - GeoIP에서 국가 별 매장을 어떻게 운영 할 수 있습니까?
Magento 백엔드에서 사용자는 Concret Store를 국가별로로드하도록 구성 할 수 있습니다. 한 눈에 촬영
이, 내가 좋은 해결책을 얻을 내 진행 중 클래스 Mage_Core_Model_App
public function run($params)
{
$options = isset($params['options']) ? $params['options'] : array();
$this->baseInit($options);
if ($this->_cache->processRequest()) {
$this->getResponse()->sendResponse();
} else {
$this->_initModules();
$this->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
if ($this->_config->isLocalConfigLoaded()) {
//$scopeCode = isset($params['scope_code']) ? $params['scope_code'] : '';
//===============custom scope by country======================
$scopeCode = Mage::helper('custom/module')->getStoreByGeoip();
//===============custom scope by country======================
$scopeType = isset($params['scope_type']) ? $params['scope_type'] : 'store';
$this->_initCurrentStore($scopeCode, $scopeType);
$this->_initRequest();
Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
}
$this->getFrontController()->dispatch();
}
return $this;
}
에서 메서드를 참조하십시오, 나는 또 다른 대안은 생각했다. 의 index.php에서
다음 코드 쓰기
: 당신이하지 않은 경우이 방법은 객체를 생성하기 때문에 성능이 haven't 위험한 생각Mage::app();
Mage::Helper('custom/helper')->getRunCodeByGeoio();
Mage::run($mageRunCode, $mageRunType);
을
/**
* Get initialized application object.
*
* @param string $code
* @param string $type
* @param string|array $options
* @return Mage_Core_Model_App
*/
public static function app($code = '', $type = 'store', $options = array())
{
if (null === self::$_app) {
self::$_app = new Mage_Core_Model_App();
self::setRoot();
self::$_events = new Varien_Event_Collection();
self::$_config = new Mage_Core_Model_Config();
Varien_Profiler::start('self::app::init');
self::$_app->init($code, $type, $options);
Varien_Profiler::stop('self::app::init');
self::$_app->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
}
return self::$_app;
}
그리고 전에 내 질문은 ......
해결책을 얻는 가장 좋은 방법은 무엇입니까 ?? 내가 생각
수정도 다시 사용 Mage_Core_Model_App 매우 위험
내가 계층에서 어떤 이벤트를해야하지는
또 다른 옵션은 index.php를에서 사업을했지만 백엔드 에 의해 관리를 손실
검색 중 .... 많은 요구 사항을 충족하는 확장 프로그램을 찾았습니다. http://www.mageworx.com/store-and-currency-auto-switcher-magento-extension.html 다음 제품을 구매하거나 유사한 확장 프로그램을 만들겠습니다.
나는 동일한 임무를 부여 받았고 주목할만한 그런 사건을 찾아 보려고했지만 내가 성취 할 수 있었던 유일한 길은 (전체 과정을 방문자의 주소로)) 특정 (할당 된) 저장소로 리디렉션. –
이 모듈은 귀하를 도울 수 있습니다 http://www.mageworx.com/store-and-currency-auto-switcher-magento-extension.html – davidselo