[Magento] 503 error after installing extensions

Hello, I just installed Magento shopping cart, via host monster. Earlier in the day, I installed a bunch of extensions through Magento Connect Manager. When I went to go back to my Admin section, I got the 503 Error.

“Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”

maintenance-flag

I’ve seen this happen before after upgrading or installing extensions and in many of the cases it appeared to be that the maintenance.flag stuck. Check your Magento installation root folder, look for that file and then delete it.

maintenance.flag.solution

[Tofu And Tomato] [Magento Solutions] Fix email not sent

Today, my client at http://www.dubuy.it/ told me that, he had an weird problem with email settings in Magento, he had never receive any sale / order emails after submitting one-page-checkout form.

If the order displays the email as sent and you or your clients are not receiving the email, then the problem is most likely the email settings you have for Magento or the local email server that Magento is using.

I also checked the settings:

  • Admin -> Configuration > Advanced -> System > SMTP Settings and see that you do not have emails disabled.
  • Admin -> Configuration > General > Store Email Addresses and check if you have the email addresses in there correctly. Sometimes email servers would refuse to send email if the senders email is not a proper email address.

However, the settings are correct but emails still were not sent. After digging into the code, I found the issue:

Just been looking into this myself. I’ve followed the code and functions back to this function “public function sendNewOrderEmail()” in:

app/code/core/Mage/Sales/Model/Order.php

starting at line 1270 is the following code:

$emailSentAttributeValue = $this->load($this->getId())->getData('email_sent');
    $this->setEmailSent((bool)$emailSentAttributeValue);
    if ($this->getEmailSent()) {
        return $this;
    }

This is checking the sales_flat_order db table to see if the email has already been sent to the customer and if so just to return, but this does not send the email and should throw an error. So I would say it is a bug somewhere. To fix it so you can resend order/invoice emails etc..

Copy

app/code/core/Mage/Sales/Model/Order.php

to

app/code/local/Mage/Sales/Model/Order.php

and comment out line 1273

if ($this->getEmailSent()) {
            //return $this;
        }

Works like a charm for me. But literally only this second tested it.

magento-fix-email-not-send

[Tofu And Tomato] How to add CSS classes to Magento top links.

Ever wonder or ever hit your head on the wall what bloody template file controls the site link, footer link in Magento and how to add a class to it? That’s right, it’s thepage/template/links.phtml.

The template file generates ‘first’ and ‘last’ class in li tag, but sometimes we need more styling in each individual link list and we want to add a class either in li or anchor tag without hacking the core file or extend a class in Magento core, how do we do that?

The answer is in the xml file

magento-top-links

LET’S HAVE A LOOK AT MY CODE:Screen Shot 2014-10-18 at 11.38.48 AM