Magento - How to get the store country?

前端 未结 1 1066
执笔经年
执笔经年 2021-02-10 14:38

how to get the store country, to show it in the transsactional E-mails?

Thanks a lot.

相关标签:
1条回答
  • 2021-02-10 15:16

    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 讨论(0)
提交回复
热议问题