Disable Magento extention/module on mobile theme

百般思念 提交于 2019-12-13 04:24:14

问题


An extension I have installed on my Magento site overwrites the view.phtml file for the product pages, even on the mobile site. I would like to use the mobile template's view.phtml when viewing from a mobile device.

I've thought of some options to fix the problem, but don't know how to do it, or which method would work best..

  • disable the module overriding the template file, only when viewed via a mobile device (make it device-dependent somehow)
  • edit the module's layout xml to conditionally override the template files, based on device (not sure if this is possible either)
  • ?????

Any ideas? =\


回答1:


The module most likely uses it's own layout XML file within the default Magento theme to override the view.phtml.

  1. Find the module's layout XML file inside of app/design/frontend/default/default/layout/MODULENAME.xml (this is the common format)

  2. Copy that XML file to your mobile theme's layout folder.

  3. Open the XML file, and look for the view.phtml template override. It will look something like: template="MODULENAME/path/to/view.phtml"

  4. Change this back to the default, which is: catalog/product/view.phtml

Save the file, flush your Magento caches. The product page layout should revert back to your default view.phtml file when viewing the mobile template.

If you want to remove all overrides occuring in the module's layout XML file, you can simply delete everything inside of the file, and save it like that in the mobile theme's layout directory.



来源:https://stackoverflow.com/questions/16844561/disable-magento-extention-module-on-mobile-theme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!