B-219 Sec-55 Noida, India
+918010221733

Create a Country Drop Down in the Frontend of Magento

<?php
$_countries=
 Mage::getResourceModel(‘directory/country_collection’)
                                    ->loadData()
                                    ->toOptionArray(false) ?>
<?php if (count($_countries) > 0): ?>
    <select name=”country” id=”country”>
        <option value=””>– Please Select –</option>
        <?php foreach($_countries as $_country): ?>
            <option value=”<?php echo $_country[‘value’] ?>”>
                <?php echo $_country[‘label’] ?>
            </option>
        <?php endforeach; ?>
    </select>
<?php endif; ?>
(Visited 45 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.