9Aug/110

Temporarily Deactivate Your Magento Store With Htaccess

Here is quick snippet of code that we use all the time when upgrading or moving a Magento store. This will stop people from creating accounts, placing orders, etc... while you are in the middle of heavy database work.

Add this to your .htaccess file in your root directory and only your IP address will be able to view your website. All other visitors will get redirected to an "updating" page.

Add this to your .htaccess file (directly after RewriteEngine On):

RewriteCond %{REMOTE_HOST} !^123\.45\.67\.89
RewriteCond %{REQUEST_URI} !/updating\.html$
RewriteRule \.*$ /updating.html [R=302,L]

Don't forget to create a file called updating.html and put the message that you want visitors to see while your site is down.

29Jul/110

Upgrade to 1.5.1.0 Shows a 404 Error on the Frontend

I just upgraded a store from 1.4.2 to 1.5.1.0 and when I loaded the frontend I got a 404 error. This is a multi-store magento setup. The fix is to login to the admin, go to System > Manage Stores, find the default store (which is probably disabled) and simply enable it. Voila! The frontend works now. This must be a bug in 1.5.1.0.

Hope it helps someone!

23Feb/112

Troubleshooting Email Sending Problems in Magento

We just upgraded from Magento 1.3 to Magento 1.4.2, switched hosting providers, and suddenly our transactional emails were not being sent out. We were using the SMTP Pro extension by Ashley Schroeder (highly recommended, btw).

The problem turned out to be with our hosting provider, Nexcess. They were blocking port 587 in their firewall. The SMTP Pro extension connects to your Google Apps account through port 587.

We figured this out using a very simple script that can be helpful in a variety of ways (this was originally found on Google Groups, I can't seem to find it again or I would be happy to give attribution):

$fp = fsockopen("smtp.gmail.com",   25,   &$errno,   &$errstr,   10);
if(!$fp) {
     echo "smtp.gmail.com 587 - $errstr ($errno) \n";
} else {
     echo "smtp.gmail.com 587 -  ok \n";
}

Run this php script within your root Magento directory to see if you are able to connect to smtp.gmail.com on port 587. You can easily change the port number to test access to other ports. If you get an error, contact your hosting company to have them remove the block. If you get an "Ok", time to start digging a little deeper. Good luck! Email problems can be a headache in Magento.

If you are still having issues, contact us and we may be able to help you resolve it.

16Jul/1020

Checkout does not work with Credit Card payment method in Magento 1.4.1.0

The Magento team has changed the way credit card numbers are validated in Magento version 1.4.1.0. The new method requires an additional JS include in your page.xml.

<action  method="addJs"><script>lib/ccard.js</script></action>