[英]Magento - How to get the store country?
如何获得商店国家,在交易电子邮件中显示它?
非常感谢。
要首先获得国家/地区对象,您必须获取当前商店的国家/地区代码
$countryCode = Mage::getStoreConfig('general/country/default');
然后得到国家对象
$country = Mage::getModel('directory/country')->loadByCode($countryCode);
当您拥有该对象时,将其分配给电子邮件模板中的变量没有问题
$mailer = Mage::getModel('core/email_template_mailer');
$mailer->setTemplateParams(array(
'country' => $country
));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.