Archive for the ‘Code’ Category

If, in the course of your website, you use the Magento Downloader, you receive an error crying, “ERROR: failed to mkdir”, here’s a tip I just figured out.

If you moved your Magento to a new domain, check your path’s in your Downloader PEAR.ini file (/downloader/pearlib/pear.ini).  In my case, when i changed the domain name Plesk changed the saved folder name as well.  You can get an updated path by creating a PHPINFO file and saving it in there and checking the values there.  If the path isn’t the same as what’s in that serialized array, you’ll have to update all the paths in the PEAR.ini file.  Also be sure to update the string length, or PHP will throw another error.

Happy Computing!

I ran into a recent problem with Magento on a Windows/IIS install. From the admin, the I couldn’t navigate to the ConnectManager; instead it bounced me to the 404 page.

Confident that a fresh install can’t be quirky, I paused and thought it had to be a permissions issue. I opened the folder, checked the permissions, and IUSR_<> had the right permissions. So i kept snooping around and found that, on this particular box, CREATOR/OWNER had no permissions, so I applied them according to the Magento Permissions guide, and voila, everything worked as expected.

If your having problems with Magento ConnectManger, double-check the permissions on everything. And remember, if it’s a remote host, FTP may not be setting it as you expect.

I’ve found a great new website that has some quick and easy snippits of code.  Snippi.net has a good base of code that allows you to integrate Magento into non-Magento pages, and even can be used to write your own module.

Cheat sheets are blessed invention; a handy reference for those times when your code calls for something common, but for the life of you, you can’t remember the details.  Usually I just Google whatever I need, but I’ve came across these cheat sheets and have them handy.

Magento Events:

http://activecodeline.com/wp-content/uploads/2009/03/magento-events-cheat-sheet.pdf

PHP Cheat Sheet:

http://www.gosquared.com/images/help_sheets/PHP%20Help%20Sheet%2001.pdf

WordPress Cheat Sheet:

http://www.gosquared.com/images/help_sheets/WordPress-Help-Sheet.pdf

…and a whole crapload more can be found on GoSquared’s site.

Two of the most popular open-source packages available are WordPress and Magento, and tying them together isn’t an impossible task, but it’s not exactly straightforward either. I found this link on the Magento twitter, and thought I’d repost it.

http://www.magjournal.com/2009/05/wordpress-and-magento/