Monday, 9 June 2014

Magento send email using smtp

First we need to Override Magento Core Files Into local

Go to : app > code > core > Mage > Core > Model > Email.php
AND
app > code > core > Mage > Core > Model >Email > Template.php

Copy These files and paste here

Go to : app > code > local > Mage > Core > Model > Email.php
AND
app > code > local > Mage > Core > Model >Email > Template.php


After paste open these files and add following code in "send" function with your credentials:

$config = array('ssl' => 'tls',
'port' => 587,
'auth' => 'login',
'username' => 'username@gmail.com',
'password' => 'password');

$transport = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config); 
and replace: 
$mail->send(); 
with:
$mail->send($transport);
 
After this clear your cache.
Now magento will be able to send emails for you.
Best of luck 

Sunday, 8 June 2014

Magento show image over system config menu tab of extension

This article shows image on system configuration (System -> Configuration) menu with menu tab for your custom module.

Let us suppose, you have already created a local module.


Go to in \app\code\local\MyChannel\MyModule\etc\system.xml

<tabs>
        <test>           
            <label><![CDATA[<div style="position: absolute;"><img id="test_block" src="" alt="" border="0" /></div>&nbsp;<script>
            var n = SKIN_URL.indexOf("adminhtml");
            $('test_block').src = SKIN_URL.substring(0, n) + "adminhtml/default/default/images/test.png";
            </script>]]></label>
            <sort_order>400</sort_order>
        </test>           
    </tabs>

We have created a new system tab with Image ‘test.png’.

Saturday, 31 May 2014

Magento Reset products per page value to default on pageload

Go to : app > code > core > Mage > Catalog > Block > Product > List > Toolbar.php

Copy this file and paste here

Go to : app > code > local > Mage > Catalog > Block > Product > List > Toolbar.php

Open this file and find this

"$limit = Mage::getSingleton('catalog/session')->getLimitPage()" aroung 745 line no.

replace with

$limit = Mage::getStoreConfig('catalog/frontend/list_per_page');

After completed above steps Please remove cache

Best of luck