我已经为前端创建了js文件和default_head_blocks.xml。现在,我想在default_head_blocks.xml文件中获得system.xml文件的启用或禁用功能。结论是如果启用了模块,则在default_head_blocks.xml中,否则将运行js文件代码。“如何执行?
禁用模块的最佳方法是使用config.php
文件而不是XML
。
您必须将1
文件中的值从0
更改为app/etc/config.php
。
禁用Magento_Version
模块的示例:
<?php
return [
'modules' => [
...
'Magento_Version' => 0,
...
]
];