更新时间:2023-09-18 23:28:16
如果要在magento的运行时设置程序包和主题,只需使用此代码段即可.
If you want to Set package and theme at run time in magento simply use this code snippet.
创建一个函数ex. changeTheme('主题名称');并根据您的要求运行此功能
create one function ex. changeTheme('Theme-name'); and run this function with your requirement
在php启动后在您的head.phtml中添加此功能.
add this function in your head.phtml after php start.
function changeTheme($themeName)
{
Mage::getDesign()->setArea('frontend') //Area (frontend|adminhtml)
->setPackageName('default') //Name of Package
->setTheme($themeName); // Name of theme
}
享受:)