Friday 22 May 2015

Magento : How to change the language selector

Add following code in app/design/frontend/base/default/template/page/switch/language.phtml

<?php if (count($this->getStores()) > 1): ?>
    <ul>
        <?php foreach ($this->getStores() as $_lang): ?>
            <?php if ($_lang->getId() != $this->getCurrentStoreId()): ?>
                <li class="language-<?php echo $this->htmlEscape($_lang->getCode()); ?>">
                    <a href="<?php echo $_lang->getCurrentUrl() ?>"><?php echo $this->htmlEscape($_lang->getName()) ?></a>
                </li>
            <?php endif; ?>
        <?php endforeach; ?>
    </ul>
<?php endif; ?>

Thursday 21 May 2015

Magento : How to fix the error (#11601: Request for billing address failed) of paypal

Resolve this error goto System >> Configuration >> payment methods >> Paypal express checkout (configure)>Basic Settings - PayPal Express Checkout >>  advanced settings >> require customer’s billing address. Set this to No

after check...

Hope this help some one....

Magento : How to apply magento patch without SSH

Review following link here your can apply security pathces.

http://magentary.com/kb/apply-supee-5344-and-supee-1533-without-ssh/

Magento : Destination folder is not writable or does not exist error.

Goto : lib/Varien/File/Uploader.php

Temprary change following code and try to upload image. Now in error message you can see folder path.
in folder path you have to give file permission 777 and it working normal. after error is resolved revert your code as it is.


if( !is_writable($destinationFolder) ) {
    var_dump($destinationFolder);  
    throw new Exception(''.$destinationFolder.'Destination folder is not writable or does not exists.');
}

Hope this help.....

Wednesday 20 May 2015

Magento : How to add Drop-Down of Countries

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

Create a Country Drop Down in the Magento Admin

<?php

    $fieldset->addField('country', 'select', array(
        'name'  => 'country',
        'label'     => 'Country',
        'values'    => Mage::getModel('adminhtml/system_config_source_country')->toOptionArray(),
    ));

?>