You are viewing an old revision of this post, from December 26, 2014 @ 15:03:54. See below for differences between this version and the current revision.

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; ?>

Revisions

  • December 26, 2014 @ 15:03:54 [Current Revision] by admin
  • December 26, 2014 @ 15:03:54 by admin

Revision Differences

There are no differences between the December 26, 2014 @ 15:03:54 revision and the current revision. (Maybe only post meta information was changed.)

No comments yet.

Leave a Reply