开发者

Magento - How to get the store country?

how 开发者_开发问答to get the store country, to show it in the transsactional E-mails?

Thanks a lot.


To achieve country object first you have to get country code for current store

$countryCode = Mage::getStoreConfig('general/country/default');

then get country Object

$country = Mage::getModel('directory/country')->loadByCode($countryCode);

When you have the object, there is no problem to assign it to variable in email template

$mailer = Mage::getModel('core/email_template_mailer');
$mailer->setTemplateParams(array(
    'country' => $country
));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜