在Magento XML layut或配置文件中,我們可以寫的ifconfig作爲參數標籤應用的條件這樣使用ifconfig參數
<action method="addLink" translate="label title" module="contacts" ifconfig="contacts/contacts/enabled">
<label>Contact Us</label>
<url>contacts</url>
<title>Contact Us</title>
<prepare>true</prepare>
</action>
我試圖找到這個函數的使用ifconfig替代
Mage::getStoreConfig($path,Mage::app()->getStore());
這樣我可以在ifconfig中包含存儲條件和路徑。 任何幫助將不勝感激。
感謝馬維斯。幾乎沒有改變你的解決方案滿足了我的要求。我設置了store =「true」而不是store =「2」,並寫入store =「true」,而不是if(!Mage :: getStoreConfigFlag($ configPath,$ node ['store'])) :: getStoreConfigFlag($ configPath,Mage :: app() - > getStore()))這樣就需要當前的商店設置。 –
首先是馬呂斯(不是馬維斯):)。其次,如果您想檢查當前商店的配置值,則不需要第二個參數。如果未提供第二個參數,則檢查當前商店的值。 – Marius