문제

I tried :

$store = Mage::app()->getStore(); 
$configValue = Mage::getStoreConfig('design/themes/templates', $store);

but it returned null. Where is my fault? p.s. Value set

도움이 되었습니까?

해결책

If you want to get the config of the currently viewed store:

$configValue = Mage::getStoreConfig('sectionName/groupName/fieldName');

If you want to get the config of one of the other stores and not the current one:

$store = Mage::app()->getStore();
$configValue = Mage::getStoreConfig('sectionName/groupName/fieldName', $store);

I guess you want to get your current theme, so you need this:

$configValue = Mage::getStoreConfig('design/theme/template');

다른 팁

For Magento 1.9 :

Get Store Id :
Mage::app()->getStore()->getStoreId();
Get Config Value :
$configValue = Mage::getStoreConfig('sectionName/groupName/fieldName', $storeId);
as per store vise :
$storeId = 2; // ID of the store you want to fetch the value of $configValue = Mage::getStoreConfig('sectionName/groupName/fieldName', $storeId);

Get Config Value in phtml:

<?php echo Mage::getStoreConfig('design/themes/templates') ?>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top