Search This Blog

Saturday 31 March 2012

MySQL Database Search & Replace Tool

Thursday 29 March 2012

Emails not sending in Magento

There will be many scenarios for the email sending issue in Magento.
  1. Check if email sending is completely disabled in Magento: System => Configuration =>System tab ... Under Mail Sending Settings sub section "Disable Email Communications" should be set to NO
  2. Does Magento sending other native emails (new registration, order confirmation etc)?
  3. Check if the email sending is enabled for shipments in Magento admin: System => Configuration => Sales Emails => Shipment Comments should be enabled (By default it is enabled)
  4. Is Magento using any extension to send the emails? If this is the case click here
  5. If Magento is not using any extension to send the emails then we need to check the server whether it is supporting the email sending or not. 
  6. If the issue is in 1.3.1 version then the solution will be found here
  7. If you server does not support email sending then use the SMTP Pro extension
    1. http://www.magentocommerce.com/magento-connect/aschroder-com-smtp-pro-email-free-and-easy-magento-emailing-for-smtp-gmail-or-google-apps-email.html
    2. http://www.magentocommerce.com/magento-connect/turbo-smtp-email.html
    3. http://www.magentocommerce.com/magento-connect/aschroder-com-google-apps-email-gmail.html 
    4. http://www.magentocommerce.com/magento-connect/advanced-smtp-artson-it.html
    5. http://www.magentocommerce.com/magento-connect/turbo-smtp-email.html
  8. Even if you use the SMTP pro extension doesnt't help you then you may directly change the script to send emails from SMTP. 

Thursday 22 March 2012

Moving Expression Engine 1.6.7 to New server:

1. Export Database From old server
2. Download all the files from old hosting
3. Create new database and import the DB exported in step 1
4. Upload all the files to new server
5. Change configuration settings in /system/config.php file. Here system may vary based folder name.
6. Look for the DB information set in extensions and Modules
7. Change the full paths from Old to New
8. Change the following file permissions
    1. .htaccess - 777
    2. /system/templates/ - 777 (Recursively for sub folders and files)
    3. /system/config.php - 666
9. Now you can able to login to admin section in new server
10. Change the full paths in Admin settings to reflect New server DOCUMENT_ROOT
11. Remove ALL cache
12. You are done!!!!

Note: Dont change the full paths directly in database it causes the issue which doesn't load the system preferences. Hence you can't access either site or admin section

More info for latest versions can be found at http://expressionengine.com/user_guide/installation/moving.html

Fatal error: Maximum function nesting level of '100' reached, aborting!

If you are getting the Fatal error: Maximum function nesting level of  '100' reached, aborting! error, that means its a problem with the xDebug settings on your server.


You need to increase the limit of the xdebug.max_nesting_level in your php.ini file.  It seems to be set to 100 by default.  I set mine to 1000 which solved the issue.

xdebug.max_nesting_level=1000

Also another scenario for this issue is with CashOnDelivery Payment method. However i have not tested this scenario. You can find more information at http://www.magentocommerce.com/boards/viewthread/176650/ 

Monday 19 March 2012

Differences in Magento Connect Versions

How do I know which version of Magento Connect Manager that I have?

The only versions of Magento which carry 2.0 are:
  • Enterprise Edition 1.9-RC3 & later
  • Professional Edition 1.9 & later
  • Community Edition 1.4.2.0-RC1 only
  • Community Edition 1.5 & later
Please be aware that Magento 1.4.2.0-RC1 was considered a “Release Candidate” and was released in a beta state. Beta versions are not intended for production use.

For more info click here

Thursday 15 March 2012

Magento Event/Observer Hooks Cheat Sheet

You can find the Magento events / observers of latest version at http://www.nicksays.co.uk/magento_events_cheat_sheet/

Creating your own Magento session

Suppose you have to access your Magento session from outside the Magento system (and it’s folders), and also, you want to put some relevant data into session and retrieve it on the other side. The following procedure on the Magento side will allow you to do that:
1
Mage::getSingleton('core/session')->setMyData('exampleString');
where MyData is the name of your attribute, and you will retrieve it with getMyData. Here, you can use any name you wish, but try to avoid names which can collide with the existing API and reserved words.
On the other side you can access the session and get the data with the following code:
1
2
3
4
5
6
7
$mageFilename = realpath('MageShop/app/Mage.php');
require_once( $mageFilename );
umask(0);
 
Mage::app();
$session = Mage::getSingleton('core/session', array('name' => 'frontend'));
$data= $session ->getMyData(true);
On the line 1 the access to the main Magento folder is required, so here you either specify relative or absolute path to the Mage.php. The parameter true on the line 7 function call is the flag for “retrieve and remove from session” .

I found this useful information here 

Friday 9 March 2012

SKYPE and WAMP server conflicting

 The issue is Skype and Wamp server both are using same port number 80.

Skype Tools->Options->Advanced->Connection->UNCHECK "use port 80 and 443 as alternative incomming ports".

That's all you are done!!!!!

Apache / Wamp not starting in Windows XP


1. Check the Apache, MySql and PHP log files for any errors.

2. Check whether any other application is running on same port as described below

Commands to see the process list along with Process ID (PID)
Netstat –o
netstat -aon

To Kill the process using ID
taskkill /PID 827

To Forcefully Kill the process using ID
taskkill /F /PID 827

More Information can be found at :


Add column to mysql table if it does not exist in the table

<?php
$DBHOST = 'HOSTNAME';
$DBUSER = 'USERNAME';
$DBPASS = 'PASSWORD';
$DATABASE = 'DBNAME';
$table = 'talble_name';
$column = "column_name";

mysql_connect($DBHOST,$DBUSER,$DBPASS) or die(mysql_error());
mysql_select_db($DATABASE) or die(mysql_error());
$result=mysql_query("SELECT $column FROM $table;");
if (mysql_errno())
{
        echo "Unknown column CREATE one first";

        // Alter table add column goes here
}
else
{
          echo "column exists";
}
mysql_close();
?>

 

Wednesday 7 March 2012

Magento: Format Price

<?php echo $formattedPrice = Mage::helper('core')->currency('100.00',true,false); ?>

OR

<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?> 90.00