How to include a phtml file in Magento 2

Use the following code to include a phtml file via the type=“core/template” block in Magento 2: Continue Reading

Use the following code to include a phtml file via the type=“core/template” block in Magento 2: Continue Reading

The registration.php file is a kind of the entry point of every Magento 2 module. Being the equivalent of app/etc/modules/[Namespace]_[Module].xml introduced in Magento 1, registration.php plays similar functions, but it is a part of the module itself. Continue Reading

To load a JavaScript file of a custom module in Magento 2, you have to include an extension’s base javascript file via layout instructions. Continue Reading

To overwrite a template via module in Magento 2, have to add a layout folder to your module file [Vendor]/[ModuleName]/view/adminhtml/layout/catalog_product_options.xml Continue Reading

To create Magento 2 shortcuts for performing command line tasks on Windows, perform the following tasks: Continue Reading

You can rely on the $this->addChild function to add a child block in Magento 2. Check the following example: Continue Reading

Since Magento 2 utilizes the standard jQuery UI Tabs Widget, you should catch the tabsactivate event to catch the admin tab switching: Continue Reading

Being a jQuery UI widget Magento 2 media browser provides administrators with the ability to use a media library. Thus, they can easily upload images to media library and choose images from it. Continue Reading

Magento 2 uses the pub/media folder for storing images and other media data. The following function returns its url for the current store: Continue Reading

There is no class Magento\Catalog\Block\Product\Widget\Link in the the catalog_product_link widget declaration, since it is a virtual type. Besides, Magento\Catalog\Block\Product\Widget\Link is an alias to Magento\Catalog\Block\Widget\Link with a custom dependency injection. Please note that an argument entityResource has the Magento\Catalog\Model\ResourceModel\Product type. Continue Reading