You are currently browsing the archives for the Magento category


Enabling Exception Reporting in Magento

In the most recent release, Magento no longer displays a stack trace to the screen in the default install. Instead, you get a message that “Exception printing is disabled by default for security reasons.”

That’s a good change for the default, but if you’re doing development in Magento, you need to see what those error messages say in order to get your code working.

I checked in the admin under configuration to try to enable exception printing, to no avail.

It turns out this is done with a configuration file in the distribution. If you look to your Magento install, under /errors/ you’ll find local.xml.sample. This file is configured to display errors to the screen. To enable it, copy it to local.xml and voila! You have useful stack traces again.

Something that’s even cooler is the configuration gives you the option to send error reports to an email address. This is great for a production site. You can be notified the moment a customer gets an error on your site, so you can get in and fix it right away.

Good luck!

A helpful reference of Magento static methods

From Prattski.com:

http://prattski.com/2010/10/25/magento-mage-static-functions/

Script to help create Magento modules

Magento modules are somewhat complex, with various files scattered about to make them work correctly.

I started on a script today to generate a basic module automatically. It’s based on the popular Magento ModuleCreator plugin that can be found here.

Mine is a shell script, which I hope is a little easier to use. You can find it on my Github page, under Magento-Module-Creator.

Download the current version.

Magento Admin Login not working

Just set up a Magento site for a project at work (internal, on a non-production server). I was baffled for a few minutes because I couldn’t get logged into the admin section. I would enter my username and password, but then I’d get redirected back to the login page.

There was nothing in the error log that would indicate a problem.

After checking a few things, I noticed the time on the server was not set correctly. I reset it using the ‘date’ command, and voila, the login worked.

Turns out the server was setting an ‘expires’ value in the cookie based on the date and time on the server. This date was being set 6 hours behind, which is just over the allowed login time before you need to log back in.

Generating your own reports in Magento

From the Inchoo Magento Blog.

Downloading Magento Connect Extensions from the command line

I’m not a big fan of Magento’s Magento Connect Manager. It’s a web based tool designed to let you download an install extensions from a web interface.

For it to work, you need to allow write access to your entire Magento codebase so the web server can overwrite files. This just makes me nervous, and there’s no concise explanation on how to set permissions back again. (I have a little script for fixing Magento permissions, which I’ll post a link to later).

Today I figured out a preferable way to download extensions from Magento connect. It’s by using the pear executable that comes with Magento. The trick is to initialize the downloader to use the Magento Connect servers.

To do that you need to run the mage-setup command with the pear client in your Magento root.


$ ./pear mage-setup

This will add the Magento “channels” to your configuration. Now, if you run:


$ ./pear download [Extension Key]

the compressed tarball for your extension will be downloaded to your Magento root directory. At that point you can open it up, inspect, and install it manually, if that’s your preference.

What I'm working on this month

I’ve got an aggressive schedule lined up at Probus OneTouch this month, one that I’m really excited about. The goal in front of me is to fully automate order processing, and set up integration between Magento and SAP Business One.

First, however, I’m working on a little database application that we’re going to use to help us keep track of our SKUs. I call it SKUtee. I’m writing it in PHP using Zend Framework. While I’ve had a bunch of exposure to Zend Framework by working with Magento this is my first project from scratch using ZF.

I’ll write more about SKUtee in the next couple of weeks as a case study of writing a small custom application to solve a unique business problem.

After SKUtee is done, I’ll be implementing an addon to Magento to import customer orders from Ebay and Amazon. In the past we’ve used another application in house to funnel orders from Ebay, Amazon, and Magento into a single database to use for order processing. This addon will import all orders into Magento, so our customer service staff will have a single place to go for all orders. Getting this set up is a priority for our SAP implementation project as we’re only planning on integrating SAP with Magento — not with Ebay or Amazon. Orders from those channels will come into the SAP system from the Magento feed for processing.

Later this month, I’ll be adding a product called Help Desk Ultimate to our Magento install to enable our Customer Service staff to more easily keep track of customer requests. This product will also get integrated with SAP, as we’ll link “service calls” in SAP with customer tickets on Magento. Our customer service agents will use Help Desk Ultimate to manage their open issues with customers. Our tech service crew will use SAP for anything that involves receiving returns or pulling items from stock for repairs. Our goal is to better track cost of service and identify warranty issues to charge back to our factories, while also making it easier for customer service to keep track of who needs help and who doesn’t.

Looking at the calendar, it looks like there’s only about 3 more weeks in the month, so I’m going to be busy! I’m hoping I can get this all banged out in time because Jenny and I have a baby on the way. If he decides to come ahead of schedule, then some of this stuff might have to happen in June. We’ll see! It’s good to be busy.