Magento – magento currency selection

currencymagento-1.7

In the product category page I have a block 'select your currency',but it does not show any option in the list.
My currency.phtml file is

<?php if($this->getCurrencyCount()>=0): ?>
<div class="block-currency">
    <div class="block_title">
        <strong><span><?php echo $this->__('Select Your Currency') ?></span></strong>
    </div>
    <div class="block-content">
        <select name="currency" title="<?php echo $this->__('Select Your Currency') ?>" onchange="setLocation(this.value)" >
        <?php foreach ($this->getCurrencies() as $_code => $_name): ?>

            <option value="<?php echo $this->getSwitchCurrencyUrl($_code) ?>"<?php if($_code==$this->getCurrentCurrencyCode()): ?> selected="selected"<?php endif; ?>>
                <?php echo $_name ?> - <?php echo $_code ?>
            </option>
        <?php endforeach; ?>
        </select>
        <?php echo $_code;?>
    </div>
</div>
<?php endif; ?>

Is there any problem in this file ?
In the system->configuration->currency setup
Base currency: US dollar
Default display currency:Canadian Dollar
Allowed currencies:Canadian Dollar

In manage currency rate
1.03 can=1.00 US dollar

How to get more than one option in the list ?
also i want to know the purpose of all the layout handles in directory.xml file like
catalog_category_layered
catalogsearch_advanced_index
catalogsearch_result_index
catalogsearch_advanced_result etc.

Please help me.
Thanks in advance.

Best Answer

For the currencies I'd suggest reading this article by Inchoo as it clearly outlines how to manage the available currencies and some nice code snippets on how to display them to your own liking in the template.

On your second part of the question (in the future I would advise you to split them up into 2 questions). The handles refer to types of pages in Magento. For example catalog_category_layered applies to all Category pages that implement layered navigation while catalogsearch_result_index applies to the page that displays the search results. This Magento tutorial explains a lot on how the layout XML system works including the page handles.

Related Topic