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 the function type (before, after, around) – they are having a dynamic number of parameters.

Read more “M2 Defining a plugin”

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.

  1.  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 you know what it can happen, example:

Read more “Setup Magento 2 with Sample Data through Composer”