geschrieben von
am 23. Februar 2017 - 1:37

Although there’s no documentation stating this, based on system behavior it seems like the


class files are sort of required by a Magento module.

I say sort of required because you can run a module without them. You can use that module to add features to Magento. However, a version number for that module will not be added to the setup_module table unless the InstallSchema class is present.

I discovered this when I tried adding an UpgradeSchema class to a module that didn’t have an InstallSchema. The UpgradeSchema still ran, but calling $context->getVersion()

public function upgrade( SchemaSetupInterface $setup, ModuleContextInterface $context ) { $setup->startSetup(); $version = '[' . $context->getVersion() . ']'; file_put_contents('/tmp/schema.log',$version . "\n",FILE_APPEND); $setup->endSetup(); }

returned an empty string, as…

geschrieben von
am 21. Februar 2017 - 19:44
This entry is part 1 of 1 in the series Pestle. This is the first post in the series. Hot on the heels of pestle 1.1, I’ve just released the inevitable pestle 1.1.1. Pestle users should be able to pestle selfupdate and be good to go. Things in this release include An updated, and reorganized command list A magento2:generate:ui:add_to_layout, which adds a uiComponent node to a layout update XML file A magento2:generate:controller_edit_acl command, which changes an admin controller’s configuration ACL rule A magento2:generate:full_module command, which generates a shell script that can generate a “full” module. The magento2:generate:full_module command it probably […]
geschrieben von
am 21. Februar 2017 - 18:06

While PHP production environments have long made use of extra systems like memcache, varnish, and redis, most successful PHP projects also let developers and technically savvy folks drop an archive of files on a server, point the web server at those files, configure the application to point to a traditional RDMS/database, and have a working application.

After a year or so of life with the Magento 2 non-beta-beta, it’s becoming clearer that this isn’t a priority for Magento’s engineering team. The first run experience remains dismal, and the company’s efforts seem focused on tools for Silicon Vally professionals, such as Docker.

For my on work, I’m still installing Magento directly on my OS X/macOS workstation. With out of the box performance of the file based cache being what it is, I’ve started using redis as Magento’s…

geschrieben von Fabian Schmengler
am 20. Februar 2017 - 16:00
This is my weekly Kata post. Read the first one to learn what it is all about.

Last week: Coin Changer

This week it did not work out for me, I did the kata only once in PHP and that was not enough to get any particular insights. I’ll have to repeat it again some time soon! But on to the next one:

Eighth Kata: Functions Pipeline

The task: build a function pipe() that takes any number of callables as arguments and returns a new callable.
The returned callable passes any arguments to the first callable, then the result of that to the next callable, and so on, and will return the final result.
So the processing order is left to right.


// first apply strtolower(), then apply ucwords second. $f = pipe('strtolower', 'ucwords'); $f('FOO BAR') === ucwords(strtolower('FOO BAR'));

Optional follow up exercise:

implement a function compose(), which behaves just like pipe()…

geschrieben von
am 17. Februar 2017 - 1:00

Do you remember how four years ago everything needed to be responsive? Well, in the next two years, the best performing sites are going to be Progressive Web Apps (PWA).

So what makes a site a Progressive Web App?

It’s actually a combination of technologies and approach to implementation that results in a set of qualities. As defined by Google, they are:

  • Progressive - Works for everyone, features enable if they’re compatible with device.
  • Responsive - Caters to a wide range of device sizes.
  • Connectivity independent - Saves content for later to maintain functionality if offline or on poor quality connection
  • App-like - Feels like an app to the user with app-style interactions, navigation and shell.
  • Fresh - Loads in latest content when it can
  • Safe - Everything is over HTTPS for security.
  • Discoverable…
geschrieben von
am 16. Februar 2017 - 17:47

Tangentially Magento related: Magento uses the lusitanian/oauth composer package to handle some oAuth related tasks. In addition to the usual “create the cryptic Authorization: headers” code you’d expect to find in an oAuth library, there’s also these two folders of code

Each service class listed here attempts to capture each individual oAuth API’s unique take on how to authenticate, authorize, and call an API endpoint for a particular third party service.

Whenever someone like me quips that “oAuth is a tire fire…

geschrieben von
am 15. Februar 2017 - 23:40

In a typical adminhtml UI Form Component, each individual form element has a corresponding view model object. For text input fields, these view models come from the constructor function returned by the Magento_Ui/js/form/element/abstract RequireJS module.

The view model’s value property, an Knockout observable object, contains the field’s value.

This value property is set with the uiElement’s links feature.

#File: vendor/magento/module-ui/view/base/web/js/form/element/abstract.js defaults: { /* ... */ links: { value: '${ $.provider }:${ $.dataScope }' } }

The links default will set observable values on an object at the time of instantiation by pulling items from the uiRegistry. The above configuration sets the value property. The key it uses to pull values from the uiRegistry is created by the ES6 Template Literal String ${ $.provider }:${ $.dataScope }. The .provider property comes from UI Component…

geschrieben von Fabian Schmengler
am 15. Februar 2017 - 23:03
This is my weekly Kata post. Read the first one to learn what it is all about.

Last week: Roman Numerals

I liked that kata. I started with different approaches that did not work and found a simple one in the end, aided by the tests.

My first tries ended at something like this:

Expected :'IX'
Actual :'VIV'

As soon as it occured to me to treat “IV”, “IX” and so on as single digits, it was dead simple.

When I implemented the reverse, I noticed that it would be easier to check for two character “digits” like “IV” first, then for single characters. Instead of using the same list of (arabic,roman) tupels for both tasks, I decided to explicitly write both as constants $romanDigitsByValue and $romanDigitsByLength. This is a minor duplication of knowledge but I made that sacrifice to make the code more obvious. As long as these…

geschrieben von
am 15. Februar 2017 - 20:37
This entry is part 13 of 13 in the series Magento 2 UI Components. Earlier posts include Magento 2: Introducing UI Components, Magento 2: Simplest UI Component, Magento 2: Simplest UI Knockout Component, Magento 2: Simplest XSD Valid UI Component, Magento 2: ES6 Template Literals, Magento 2: uiClass Data Features, Magento 2: UI Component Data Sources, Magento 2: UI Component Retrospective, Observables, uiElement Objects, and Variable Tracking, Magento 2: uiElement Features and Checkout Application, Magento 2: Remaining uiElement Defaults, and Magento 2: Knockout.js Template Primer. This is the most recent post in the series. The quick version: I’ve just released […]
geschrieben von Ablyakim Ablyalimov
am 14. Februar 2017 - 15:43

Today, I’ll tell you how to simplify management of your product custom options with a shell script. You just need to add a criteria for a product collection, and each option of every product from the collection will be updated automatically. Our script will fetch product collections by product SKU value.

First of all, we need to add a shell script.

<?php require_once 'abstract.php'; class Atwix_Shell_Manage_Options extends Mage_Shell_Abstract { /** * @inheritdoc */ public function run() { } } $shell = new Atwix_Shell_Manage_Options(); $shell->run();

Our script will perform two scenarios – remove and create options with their values.

The “run” method looks the following way:

/** * @inheritdoc */ public function run() { $args = $this->_args; $method = key($args); if ($method == 'add') { $this->…
geschrieben von
am 13. Februar 2017 - 1:00

It's Monday morning, so you check your KPI Dashboards in Google Analytics and Magento. Everything looks ok. Great, you can get on with answering some emails. If there's a ring of truth here, then you're not alone.

Analysing performance of an ecommerce store does not need to be a data-crunching chore. It should be an exciting opportunity to learn something new about your customers and how they use your website. These insights can then be used to take pro-active actions to improve profitability and win the admiration of your colleagues!

Why Measure Performance?

I have yet to find any crystal ball solutions, so the next best thing is to use past performance as an indication of where you are heading, and why. Then add your knowledge, expertise and some gut-feeling to determine the best actions to take to improve on past performance. Simple.

If you don't have an analyst on your team, please don't ignore this vital aspect of running an ecommerce site…

geschrieben von Tom Klingenberg
am 12. Februar 2017 - 2:20

Recent Magento 2 releases and the longer list of fixes demanded a new stable release of Magerun 2.

Jürgen Thelen kindly ported the admin:notifications and design:demo-notice commands, so each time you see the COW warning in the backend there is a relief now. So a warm welcome to Jürgen, we still have PRs from him in the pipe.

More dedicate cron control is available with sys:cron:schedule. Thanks to Pieter Hoste not only for his contributions to Magerun but also for his good work keeping track of Magento 2 upstream issue progress which is easy to get lost with. I really appreciate it, it’s always good to have some feedback when working with the rough edges we see day-to-day with Magento 2.

There is even more. A longer list of fixes (we keep them at the top of the change log), if you run into an issue, file it on Github. Also if you’re interested, grab an issue from the list – preferable one of the bugs – and give it a little love.

geschrieben von Vesna Mijatovic
am 10. Februar 2017 - 12:07

Magento often organizes Partner Enablement Events, such as live demos, webinars and quick start trainings. While we participated in a number of such demos and webinars, we’ve never been a part of an on-site training for sales and business development staff aimed at solution and technology partners. This changed last week in France, and here’s our overview of what happened in Paris.

Our Paris adventure started when we received an email in December from Magento’s Amy Schade informing us about the upcoming Magento Quick Start Training (targeted for sales people and Magento new hires) and when we saw her invitation, we decided to add another event to our list.

As a prerequisite, we all had to complete free Quick start pre-learning courses which really helped us to sharpen our Magento skills, fill the gaps and learn a thing or two about new Magento products.

Time passed by really quickly and we…

geschrieben von
am 10. Februar 2017 - 0:09

Keeping with UI Component form theme but drawing a wider circle, if you take a look at HTML source of a button on a backend Magento 2 HTML form, you’ll see something like the following

<button id="back" title="Back" type="button" class="action- scalable back" onclick="location.href = '';" data-ui-id="back-button"> <button id="save" title="Save Page" type="button" class="action- scalable save primary ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" onclick="location.href = '';" data-form-role="save" data-ui-id="save-button" role="button" aria-disabled="false">

These buttons were not things…

geschrieben von (Gordon Lesti)
am 10. Februar 2017 - 0:00
Magento 2 composer dependencies visualized as interactive D3 chord diagram.
geschrieben von
am 9. Februar 2017 - 18:56
Merged Layout schema validation error in Magento 2:

A peek at the complexity deep in Magento 2’s layout rendering engine.

geschrieben von Ivona Namjesnik
am 9. Februar 2017 - 14:17

As we determinedly move through 2017, we decided to look into things which we’re building upon. The old saying goes “If you don’t know history, you are doomed to repeat it.” so we’d like to avoid any mistakes possible by learning from the previous happenings. Here’s what happened in the SEO world in 2016. and what you can do to make those trends work in your favour.

Tea Pisac is one of our consultants. She works as a part of the Inchoo Consulting Group (ICG) which handles various marketing channels for our clients (PPC, SEO, Quality Assurance and User Experience) in order to make their websites work better and their businesses earn more.

She has been with us for…

geschrieben von
am 9. Februar 2017 - 2:39

It surprised me that over a year after Magento 2’s introduction I haven’t had an opportunity to create a new form component using the UI Component system. In the extensions and themes I’ve helped folks port over it made a lot more sense to just convert the old PHP rendered HTML to the new extension. When time is money known technology trumps new, fancy, and undocumented technology.

Having a chance to touch the backend form generation code this week, any doubts I had about my previous approach with clients evaporated. Whether you call it a technology demo or a mess, form components perfectly encapsulate a lot of the the problems Magento developers face with Magento 2’s incomplete rendering layer.

This quickie’s intent is to provide a high level overview of how forms get setup in Magento2 ’s UI Component system. If there are concepts below that confuse you the Magento 2 UI…

geschrieben von Igor Furseev
am 8. Februar 2017 - 15:03

This post is a short inside-out of the newly released Magento 1 SUPEE-9652 security patch. The patch prohibits an injection of executable code to the Magento email “Reply To” param, if the “Return Path” for emails is enabled. So let’s check what it does.

Basically, the patch changes only one file: lib/Zend/Mail/Transport/Sendmail.php, updating the content of the \Zend_Mail_Transport_Sendmail::_sendMail method to:

public function _sendMail() { if ($this->parameters === null) { set_error_handler(array($this, '_handleMailErrors')); $result = mail( $this->recipients, $this->_mail->getSubject(), $this->body, $this->header); restore_error_handler(); } else { if(!is_string($…