移动设备在生活中的使用越来越多,我的某一个网站就移动设备的访问比例高达10%。 给这些移动设备优良的用户体验也迫在眉睫,还好我们的Magento core开发了iphone theme,给这些移动设备带来了优良的用户体验。 让移动设备用户访问不同的界面时,Magento有两种办法做到。 第一种就是重定向。 当用户访问Magento的时候,移动用户就会被重定向到不同的store view(多店)。 我不建议这么做,具体原因就不说了。简单来说,Magento性能有损失,seo性能下降。 第二种就是展示不同的界面。 当移动设备访问Magento时,自动匹配到移动设备的主题界面。 而且这种设置也相当简单,大家跟着我做: 1.先等到到Magento后台,默认是domain.com/admin 2.进入这个选项卡:System > Configuration > General > Design …Read the Rest
Tag: 多店
如果你为一个站的所有商店各自设置了唯一的base URL,所有你需要用来多店切换的就是下面这段代码。 只要把它粘贴的模板的某处。 当然,记住我只在自己的配置上测试过,基本上这段代码就是跳转到商店的base url。 <!– BEGIN website switcher –> <select id=”website-changer” onChange=”document.location=this.options[selectedIndex].value”> < ?php $websites = Mage::getModel(‘core/website’)->getCollection(); foreach($websites as $website) { $default_store = $website->getDefaultStore(); $url_obj = new Mage_Core_Model_Url(); $default_store_path = $url_obj->getBaseUrl(array(‘_store’=> $default_store->getCode())); ?> <option <?php if(strstr($this->helper(‘core/url’)->getCurrentUrl(), $default_store_path)):?>selected=”selected”< ?php endif; ?> value=”< ?php echo $default_store_path ?>”>< ?php echo $website->getName()?></option> < ?php } ?> </select> …Read the Rest
