1

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.

  • Did you manage to resolve your issue? – Sander Mangel Oct 1 '13 at 10:44
  • @bab did either of these answers help you? – philwinkle Nov 7 '14 at 17:44
1

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.

  • Hello Sander i read all the tutorials but i did not find any solution.Select option has no value at all. $this->getCurrencyCount() shows value=0 Is there is a problem?Please help – bab Oct 5 '13 at 14:22
1

The problem may be with the block type. I am not sure what block type you are using but to use the functions getCurrencyCount and getCurrencies this block will need to be of type Mage_Directory_Block_Currency.

If this is the case then you will need to step into these functions and see what exactly is going wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.