Magento Not Sending Order Emails

If you are having problems with Magento 1.9.X.X Community Edition not sending order email notifications, we found this simple fix on the Magento Forums. While I agree that this may not be the PROPER way to fix this issue, at least it works and is very simple to do.

Go to:

app/code/core/Mage/Core/Model/Email/Template.php

Go to line 407. It should read:

if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {

simply change that line to read:

if (!$this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {

and save your file. All we did was add a ! before the $this-> part.

Make sure you test this change BEFORE you close the file!

Hope that helps with your problems with Magento not sending order emails.

if (!$this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue)

Remove Session IDs (SID) From URL In Magento

If you’re having problems with Google and other search engines indexing the pages of your Magento Commerce site with session id’s or SID’s, (they look something like this, note the bold SID: http://www.yourdomain.com/service-truck-hardware/d-ring handles.html?SID=ck5gk65tbs0jeml5ebb9flvk27&limit=9&order=manufacturer&dir=asc), here’s the way we fixed it. You may have to try one method or the other. One way worked on one of our websites, the other way worked on the other.

In your .htaccess file, you can try this code:

## remove SID from get request query string
RewriteCond %{request_method} ^GET$
RewriteCond %{QUERY_STRING} ^(.+&)?SID=[\w]*&(.+)?$ [NC]
RewriteRule
^(.*)$ /$1?%1%2 [R=301,L,NE]

and if that doesn’t work, try this code:

## remove SID from get request query string
RewriteCond %{request_method} ^GET$
RewriteCond %{QUERY_STRING} ^((.+)&)?SID=[\w]*$ [NC]
RewriteRule
^(.*)$ /$1?%2 [R=301,L,NE]

Hope that helps!

Remove the ?___store=default from the URL In Magento

How do you remove the ?___store=default from the URL In Magento?

Open Link.php in app/code/core/Mage/Catalog/Block/Widget/Link.php

GOTO Line 91: $this->_href = $this->_href . $symbol .”___store=” . $store->getCode();

And change it to: $this->_href = $this->_href;

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded try restarting transaction

Today we ran into this error message using Magento: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

We searched around a bit and found this solution that seems to work.

In lib/Zend/Db/Statement/Pdo.php find the public function _execute and replace the function with this code:

public function _execute(array $params = null)

{

// begin changes

$tries = 0;

do {

$retry = false;

try {

if ($params !== null) {

return $this->_stmt->execute($params);

} else {

return $this->_stmt->execute();

}

} catch (PDOException $e) {

#require_once ‘Zend/Db/Statement/Exception.php’;

if ($tries < 10 and $e->getMessage()==’SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction’) {

$retry = true;

} else {

throw new Zend_Db_Statement_Exception($e->getMessage());

}

$tries++;

}

} while ($retry);

// end changes

}

Then in lib/Varien/Db/Adapter/Mysqli.php find the raw_query with:

$tries = 0;

do {

$retry = false;

try {

$this->clear_result();

$result = $this->getConnection()->query($sql);

$this->clear_result();

}

catch (Exception $e) {

if ($tries < 10 and $e->getMessage()==’SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction’) {

$retry = true;

} else {

throw $e;

}

$tries++;

}

} while ($retry);

return $result;

}

Hopefully, that will take care of the error message “SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction” for you.