browse the blogs

[ 5 Nov 2016 ]

Nearly a year into Magento 2, I finally feel like we have the tools we need to adequately debug stock system behavior. That Magento Inc. left this to the community and each partner agency to figure out on their own speaks to where their priorities are these days (marketing, enterprise partnerships, etc.), but at least we’re at a point where we can get on with the work.

The following is the first in an irregular series of quick debugging tutorials that will talk through common problems a Magento developer will need to solve. Today we’ll be answe
On the Checkout page, right/ctrl-click on the Next button and then click Inspect. You’ll see the following source.

<button data-role="opc-continue" type="submit" class="button action continue ...

[ 31 Oct 2016 ]

Hot on the heels of Commerce Bug 3.2.0, Pulse Storm has just released Commerce Bug 3.2.1. This is small but important release that adds region debugging into the KO Scopes tab.

These are the regions we talked about here last week. Free and recommended for all Commerce Bug 3 users – especially if you’re dealing with Checkout customizations.

[ 28 Oct 2016 ]

I thought I’d finished up with UI Components, but then I started investigating the checkout application and stumbled across regions.

In the aforementioned UI Components series, we learned that a “UI Component” is a nested tree of RequireJS modules and KnockoutJS templates which a programmer can use as an HTML node’s KnockoutJS view model via a custom data-binding named scope.

However, it looks like there’s another organizing method for UI Components. When you call insertChild on auiCollection/Magento_Ui/js/lib/core/class object, Magento will check the child object you’re inserting for a displayArea property. If it finds this property, Magento will update an internal regions property on the uiCollection object. You can see this on the checkout page with a …

[ 27 Oct 2016 ]

The Curious Case of Magento 2 Mixins:

Don’t let the title fool you – this article (from me) will teach you how to safely hook into the instantiation of any RequireJS module in Magento 2. This, in turn, enables all sorts of things including safe javascript rewrites/monkey-patching.

[ 21 Oct 2016 ]

Commerce Bug 3.2 Released:

Pretty excited about this one – has the UI Component debugging features that should have been there from day one.

[ 15 Oct 2016 ]

Magento 2 Tool Chain:

I’ve learned to accept, in my head, that this sort of over complication always happens when the size of the team maintaining an application or system grows. That said, I’ll never quite understand why in my heart.

[ 7 Oct 2016 ]

A technical guide to the Magento 2 checkout:

A deep dive (written by Inviqa) on the javascript checkout application in Magento 2. A nice companion to my UI Components series — the Inviqa article has some application specific details that will be useful to any developer customizing the checkout flow. (hat tip to Joe Constant)

[ 3 Oct 2016 ]

I came across this code recently while researching Magento 2’s UI Component system

initComponent: function (node) {
    if (!node.component) {
        return this;
    }

    loadDeps(node)
        .then(loadSource)
        .done(initComponent);

    return this;
}

That block in the middle might confuse a junior programmer, but I’m no spring chicken. That looks like a javascript promise and confusion around the .done(initComponent) being a different method than the initComponent whose scope we’re in at the moment, this should be straight forward code to follow.

Except – whose promises library is it? What are the nuances …

[ 3 Oct 2016 ]

Magento 2 uiClass Imports and Exports Explained:

I’m working on my own version of this as we speak, but the Jessie Maxwell does a nice job of breaking down the imports and exports feature of Magento’s UI Components.

[ 22 Sep 2016 ]

Magento 2: Approximating Local Code Pool Overrides:

Not sure if I like the idea of this becoming a common practice, but if you know your composer autoloading you can replace any class in Magento with a version of your own.