Best Advice to Extend Magento 2 Checkout

This is a continuation of Checkout tips where I started sharing tips about Magento 2 Checkout module.

Checkout is flexible now

Checkout as a single page application is implemented in a way where customizations take place. What do I mean by that? Let me explain.

Your custom PHP classes no longer require to extend core Abstract or Parent classes like we used to do it in Magento 1. “Customizability” of new Checkout has been achieved by using Composition, Strategy, Builder design patterns on both server and frontend sides.

Tips for extending Checkout

Let me share with you 7 ways to effectively customize Checkout in Magento 2. You may need this tips if you are planning to do a custom development or bring new theme which should also be applied for Checkout.

There are 2 sets of techniques or features to change user experience on frontend side or persist and process data on backend side. Let’s talk about frontend first.

It is common to change layout or UI Components before Checkout page will be served and rendered in a browser. What can we use to modify frontend?

UI Components

Usage of checkout_index_index.xml file which is used to declare the structure of UI Components in a tree way manner. As we always use XML to say that we have a child node. You may find the example of adding new UI Component for Payment validation article.

JavaScript Mixins

JavaScript Mixins are also a powerful way to change behavior or look and feel of a page. It is like Plugin or Interceptor feature in PHP world but with small differences. A custom mixin can intercept JavaScript function and provide its own logic for execution.

Layout Processors

Layout Processors are used when the initial list of declared UI Components should be modified before these components are rendered on a page. Since all components declared in layout file are static declarations, Layout Processors provides a dynamic way to modify it.

Best advice for developers from Magento Master

If you want to get real advice from one of Magento Masters, Phill gave an interview to Magento. I enjoyed reading it and especially the advice for other developers: Control your aspiration! There will be always developers who know more than you, what you can control is hard work and time you can invest in your own life. Super advice.

New Magento 2.1.3 and 2.0.11 Release

It is time to check and update to latest Magento 2.1.3 or Magento 2.0.11 version where 90 bug fixes have been introduced. This is one of the best releases since Magento 2 GA with respect to marketing, communication, quality and number of fixes.

If you like what you are reading, subscribe to The Devletter: Magento Tips and Workshops email I send every week.

Thanks.


Posted

in

by

Tags:

Comments

Leave a Reply