Magento-2-simple-CLI-script

Magento 2 Command-line interface (CLI) tools differ from those in Magento 1. In Magento 1 you could simply add a script to the “shell” directory, include abstract.php, and extend from it. Magento 2 is a bit more complicated. This post will show you how to create a simple CLI script in Magento 2.

How-to-Add-a-Custom-Admin-System-Message-in-Magento-2

Magento uses notification messages to improve user experience. You can easily add any message using the Message Manager to inform users about the success or failure of an action.

In this blog post we will cover one type of the notifications – Admin System Messages. This type of notification will appear in a pop-up block and remain in the admin panel as a reminder for the admin user until a specific condition is met. These notifications can vary from messages about invalidated indexes to vulnerability issues. Adding custom system messages can be beneficial, and we’ll show you how to do it in a few simple steps.

Adding new category attributes in Magento 2

In this post, we aim to share our expertise on creating a category attribute in Magento 2. As you may have noticed, we need to change (add or customize) category attributes from time to time. We have done it many times for Magento 1 and now we faced the same task in Magento 2. This process is very similar for both Magento versions, however there are some differences. So let’s check how we can do it step by step.

Working-with-Magento-2-Cache

Sometimes Magento developers face the need to work with Magento caches programmatically. For example, when you develop your custom module, which renders some content on front-end and this content can be managed via Admin Panel. Let’s say it is cached by the Full Page Cache (FPC). In this case you will need to notify the user that one of the cache types is invalidated and should be refreshed in order to have the changes applied. You might even want to refresh the FPC automatically with each modification. Magento 2 allows this to be performed quickly and easily.

Adding an image chooser to a Magento 2 widget

In the previous article we have described how to introduce a new widget in Magento 2. As it was mentioned, each widget field has its own input type. The input type allows determining what graphical interface component will be used to represent this field. Magento 2 has a set of simple input types out of the box such as input field, dropdown etc. Also, it has more complex components: products chooser, rules conditions component, CMS block chooser and others. However, in certain scenarios, you might want to integrate a custom input type, especially if you aim to select images from the media gallery in your widget configuration. In this post we review how to add an image chooser/uploader to your widget.

Adding an image chooser to a Magento 2 widget

Magento 2 has a handy toolkit for static content management on the site that is called Content Management System (CMS). The toolkit consists of three main parts: pages, blocks and widgets. Pages allow us to manage content of an entire page. Blocks provide an ability to edit content of separate page elements. The main difference between blocks and widgets: if you need to change block parameters, you usually have to do it programmatically. Widgets are similar to static blocks, they allow to insert various content into static pages or static blocks. As a rule, widgets have configurable parameters that can be set up when adding it via admin panel.

Configure Code Sniffer for PHPStorm and Magento 2

For a good and maintainable application, high-quality product code is essential. The code quality usually depends on the developer’s professionalism. But among the thousands of lines of code, something might be missed. Fortunately, there are several small yet useful utilities that can automate some routines and help you check the code using different rules for different coding standards. In PHP development, there are two popular utilities for code validation: Code Sniffer and Mess Detector.

Magento 2 request flow overview

It’s interesting to know how Magento 2 works “under the hood” not only for developers but for all the people, who work with the platform. Not everyone has a possibility to dig in the code deeply enough in order to check the details. In this post we will put Magento 2 request flow in layman’s terms.