开发者

How to get timezone value

开发者_如何学编程how to get the timezone drop down menu in frontend magento?


Here is the code to get all timezones:-

$timezones = Mage::getModel('core/locale')->getOptionTimezones();
echo "<pre>"; 
    print_r($timezones); 
echo "</pre>";

You will be getting an array. You can loop through the array and populate the selection/dropdown list like below:-

<select>
<?php
foreach($timezones as $timezone) {
    ?>
    <option value="<?php echo $timezone['value']; ?>"><?php echo $timezone['label']; ?></option>
    <?php
}
?>
</select>

Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜