X

Как вывести select списка стран в Magento

Для вывода select-а списка стран в своем темплейте, воспользуйтесь следующим кодом...

<?php
$customer = Mage::getSingleton('customer/session')->getCustomer(); 
$customerAddressId = $customer->getDefaultBilling();
$address = Mage::getModel('customer/address')->load($customerAddressId);
 
echo $this->getLayout()
     ->getBlockSingleton('directory/data')
     ->getCountryHtmlSelect($address->getCountryId())
;

 

Категории: Magento