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(),
    ));

?>

Friday, 15 May 2015

Magento : How to Set default product quantity to 'one' in Magento i.e. not default zero

1) Go to Admin Panel -> System -> Configuration -> Inventory-> Product Stock Options from the Menu

2) Click on Add Minimum Qty button (next to Minimum Qty Allowed in Shopping Cart option)

3)  Choose Customer Group: ALL GROUPS as you want this to be applied to all users

4) Enter 1 for Minimum Qty

5) Save Config

Magento : How to Fix Class ‘Mage_Googlecheckout_Helper_Data’ not found in in Magento updated

Please follow following steps.

1) Close the Admin Panel browser window.

2) As a user with root privileges, delete all files except config.xml from the following >directory: magento-install-dir/app/code/core/Mage/GoogleCheckout/etc

3) When you log back in to the Admin Panel, everything works as expected. If you're still encountering errors, see Getting Help With Your Installation or Upgrade.