GIT – ignore file permissions

Note: added here to find it much easier.

From git-config(1):

The -c flag can be used to set this option for one-off commands:

And the --global flag will make it be the default behavior for the logged in user.

Warning core.fileMode is not the best practice and should be used carefully. This setting…

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:

Manually removing the cache files:

You can also check the cache status First of…

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…

Set Environment Variable [Developer or Production Mode] (M2)

First, will be a good idea to check the current MODE:

The main idea is to have this (environment) variable MAGE_MODE set to one of this values: Default Developer Production   To change the MODE in Magento for the moment there are 3 ways: From CLI  (you'll be 100% sure it changed)

Using the .htaccess file:

Through your WEB…

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. 

During installation I got a series of problems, I'll try to add them between steps so you know what…

Set default home page for Magento

Make sure you created the needed page into this section:

Then, the main part, the section where you can set a page as the homepage is located into:

Don't forget, if you have a multi store check the values for the appropriate configuration scope (store)  [top left menu]