browse the blogs

[ 7 Jul 2014 ]

If you’re new to Magento, you may not realize that every remote API method has a native PHP equivalent. The why, how, and how to identify these models is covered elsewhere, but one thing I forget at my peril is how useful the API methods are when I need to serialize something as JSON or via PHP’s serialize function.

json_encode(
    Mage::getModel('catalog/product')->load($product_id)
);

$data = serialize(Mage::getModel('catalog/product')->load($product_id));

What’s great about the API load methods is they automatically return a simple PHP array full of scaler values. Compare that to something like this

json_encode(    
    Mage::getModel('catalog/product')->load($product_id)
);

While they may seem equivalent, the catalog/product object is going to have a lot of other object references — which …

[ 5 Jul 2014 ]

Can’t Log into the Admin Roundup:

Stack Exchange answer where I (attempt to?) list every possible reason the Magento Admin might not set a session cookie, creating the dreaded “can’t log into the admin” error.

[ 5 Jul 2014 ]

Anti-SQL Bias:

Developers coming into Magento are often put off by seemingly voodoo rituals like “Don’t directly manipulate the database tables with SQL”. This may be a ritual, but it’s a smart one, and my answer to this questions tells you why. It also includes an example SQL query for fetching all the product status values when you’re ready to dive deep on Magento’s EAV structure.

[ 1 Jul 2014 ]

I can’t login to Magento Admin:

Another misconfiguration that can make it impossible for developers to log into the Magento admin.

[ 29 Jun 2014 ]

tim-reynolds/magento-qconfig:

When I started using Magento the System Configuration section made me feel a little dumb — so many options, but no easy way to search for things. I’d always forget where a particular option was.

After a few months of using grep and ack to search though the system.xml files and work backwards to figure out the section, I decided to automate that process and the System Configuration Search module was the result.

Tim Reynolds had the same idea, and created a similar module named qconfig. I’ve also seen a few other implementations floating around, but I really like what Tim’s done with the search visualizations. It makes me extra embarrassed about my goofy dancing arrows. …

[ 25 Jun 2014 ]

Magento system.xml hint tag. :

Some background on an abandoned “hint” tag for Magento’s system configuration form fields.

[ 19 Jun 2014 ]

Barely Magento related — mainly a tab sweep to capture some Stack Overflow questions where I’m re-familiarizing myself with DBA concepts as part of a Magento upgrade project.

Optimizing ALTER TABLE

Debugging errno: 150

More errno: 150

[ 17 Jun 2014 ]

Replay SQL Log:

An interesting project (also forked and improved by Magento stalwart fbrnc) that lets you replay the contents of Magento’s database log for the purpose of improving performance during a Setup Resource upgrade. I haven’t tried using it, but it looks useful.

Also, if there’s any computer science teachers out there, it’s a nice example of how eventually every system starts to recreate other systems (database transactions/bin-log replay).

[ 27 May 2014 ]

Vinai Koop (author of Grokking Magento) pointed me towards the magento-hackathon/composer-command-integrator Magento package (in a GitHub thread).

This packages adds a deploy-all command to the Firegento Magneto composer project which (presumably) allows users to explicitly trigger an installation of their packages into their Magneto system. (As opposed to the current Composer Installer behavior, which only installs when a package is downloaded or updated)