Magento 2 Cheat Sheet

Install Magento

Delete custom EAV attribute by code

Replace site URL

Create admin

SQL to create new user and grant privileges to table

Add URN highlighting in PHPStorm


Useful when re-compiling css

Get child block html

Overriding js

InĀ [Namespace]/[Module]/view/frontend/requirejs-config.jsadd this:

Overriding js functions (mixins)

Adding custom block

SQL to get stored module schema and data versions

MySQL database import with progress bar

Yes / No Form element

Get block html from PHP

Pushing from one branch to another

Add product attribute to quoteItem:

Get all set cookies

Add attribute to select


Ifconfig block attribute

Add h2 title to block

Find duplicated URL keys

Replace $STORE_ID with id of the store to check

Disable Re-Captcha

Saving file

Add multiselect searchable form field to adminhtml

Enabling button after gcaptcha is loaded

Same M2 instance – multiple websites

Apache config

Adding mage template using javascript

Generate attribute options


Start the Discussion!

Your email address will not be published. Required fields are marked *