目前,我正在致力于功能,这将采取子域(abc.example.com),并取决于子域,我将加载动态信息,如产品和其他信息。
我已经在服务器conf文件上配置了外卡,并在conf事件上创建了观察者。
<events>
<controller_front_init_routers>
<observers>
<controller_front_init_routers_handler>
<type>singleton</type>
<class>subdomain/observer</class>
<method>SubdomainCall</method>
<args></args>
</controller_front_init_routers_handler>
</observers>
</controller_front_init_routers>
</events><?php
class ABC_Subdomain_Model_Observer {
public function SubdomainCall(Varien_Event_Observer $observer)
{
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
$url = Mage::getSingleton('core/url')->parseUrl($currentUrl);
$path = $url->getPath();
foreach (array(
Mage::app()->getStore(),
Mage::app()->getStore(0),
) as $store)
{
// echo "<pre>";
// print_r($store->getData());
$store->setConfig('web/default/front', 'customer-service');
Mage::getConfig()->setNode('default/web/default/front', 'customer-service');
// print_r(Mage::getConfig()->getNode('default/web/default/front'));
}
}
}如何加载动态数据?
发布于 2015-08-23 17:05:23
子域名是什么意思?您的意思是您正在管理多个子域的多个商店?
如果是,那么您可以简单地为不同的商店创建不同的主页,并根据商店轻松地管理内容。
如果我错误地理解了你的问题,请纠正我。
https://stackoverflow.com/questions/32158207
复制相似问题