Categories


Archives


Recent Posts


Categories


Commerce Bug 2.1: Session Based Toggles

astorm

Frustrated by Magento? Then you’ll love Commerce Bug, the must have debugging extension for anyone using Magento. Whether you’re just starting out or you’re a seasoned pro, Commerce Bug will save you and your team hours everyday. Grab a copy and start working with Magento instead of against it.

No Frills Magento Layout is the only Magento front end book you'll ever need. Get your copy today!

Over the weekend I released an upgrade to Commerce Bug 2. There’s full details over at the Pulse Storm blog, and this is a free upgrade for registered Commerce Bug 2 users. One new feature I want to dawn attention to here is the session based toggles.

Commerce Bug 2 introduced the ability to flip a number of system configuration flags on or off without visiting the system configuration page. When I originally implemented this feature I didn’t want to change the values of the system configuration settings in Magento’s database. Instead, I stored the toggle values in Magento’s cache and altered the configuration at run time with an event observer.

While this worked, it meant that developers using Commerce Bug on shared development/staging systems could end up turning on template hints (or other toggle features) for everyone on the system. After a few months of actually using the feature (and seeing its effects on the Commerce Bug demo site, I realized this was the wrong implementation.

Commerce Bug 2.1 has changed the storage mechanism for these toggle settings from Magento’s cache to Magento’s session. This allows developers to toggle settings for their environment only. If the differences aren’t clear, this screencast should clear things up.

Beyond being a useful new feature, this is a great example of the sort of thing I put off implementing because it was a tedious pain in the butt and I didn’t think the improvements were worth it. However, now that it’s implemented I can’t imagine the extension without it.

It’s a good reminder that, as developers, sometimes we need to ignore out inner slackers, and just try something new.

Originally published May 13, 2013