How to Update Magento 2 (composer way)

Magento 2 offers possibility to update it's self through  Magento backend panel or trough composer  (described here). First of all check if the cache is enabled: php bin/magento cache:status If it is enabled you'll get something similar to this: So we need to disable the cache: That been done we can go further to the actual update process.…

M2 Defining a plugin

A plugin is used to extend or modify a public method’s behaviour by applying code before, after, or around that observed method. The first argument for the before, after, and around methods is an object that provides access to all public methods of the observed method’s class. Note: The rest of the parameters for these functions are depending on…

Magento 2 Plugin’s XML

Overview A plugin, or interceptor, is a class that modifies the behavior of public class functions by intercepting a function call and running code before, after, or around that function call. This allows you to substitute or extend the behavior of original, public methods for any class or interface. Declaring the XML A plugin for…

Clear Cache in Magento 2

The cache is the biggest issue when you develop so you need to know all the possible ways of cleaning it. There are 3 way to clean the cache (similar to Magento 1): From the backend (Admin): Through command-line (CLI) tool: # in your Magento root folder # the php from the beginning of the line can…

Maintenance mode (M2)

Magento 2 can run in one of three primary modes -- developer, production, and default. But aside from that ones there is also a maintenance mode, which is used when you want to make the site unavailable to the public during updates or other changes. You don’t use the MAGE_MODE variable -- instead, you create a…

Setup Magento 2 with Sample Data through Composer

Magento can be setup in 4 different ways, here i'm touching just the 4th - through composer.  Composer create project, the final parameter is where it will be installed Magento. In my case "./", it is in the current directory.  composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition ./ During installation I got a series of problems, I'll try to add them between steps so…