How to Add New Command Line to Magento 2

Hello everyone! In this blog, I will show you how to add new command line to Magento CLI (php bin/magento). First, please create etc/di.xml:

Next, please create CustomCommand.php file in Magestore\Console\Console\Command folder:

To check it, please type the command line: php bin/magento magestore:magestore_cli Thank you very much! Your Magento website needs a powerful […]

Read More

Cannot Export from Grid UI Component Using Custom Dataprovider

In magento 2, Ui component is used to create a grid on admin instead of block and template in magento 1. But when using it with a custom Dataprovider, you can get a issue like that: The reason is quite funny, in export controller of magento 2 core, they use setCurrentPage() function instead of setCurPage() […]

Read More

How to Use All Commands in Magento 2 CLI (Part 1)

Part 1: Manage caches using CLI Magento 2 has provided the powerful command-line interface tool (CLI). It allows you to perform tasks including installation, configuration, database backups, compiling LESS etc. In this article, I will show you how to manage caches in Magento 2 using CLI. The first you should read our previous article for […]

Read More

How to Upload File to FTP Server by Coding in Magento 2

  How to Upload File to FTP Server by Coding in Magento 2, Here are all steps for you: Create the FTP connect Use the write function to upload the file to server Hello everyone. Sometimes, we need upload some files to other server to store the data. Example, if you want to export the […]

Read More

UI Pagination Component

The UI Pagination Component is a listing/Grid Secondary Component. It responsible for rendering pagination UI and applying pagination criteria to the collection. It helps we can choose number of items to show on a page and choose the page that we want to view: Please take a look at the file vendor\magento\module-ui\view\base\ui_component\etc\definition.xml, you will see […]

Read More

How to Add Custom Indexer to Magento 2

In this topic we will show you How to Add Custom Indexer to Magento 2 through 2 steps: Step 1: Please create indexer class Step 2: please create etc/indexer.xml files Indexing is how Magento transforms data such as products, categories, and so on, to improve the performance of your storefront. As data changes, the transformed […]

Read More

How to Add Tree into Mass Action Dropdown in Backend

  In this topic we will show you How to Add Tree into Mass Action Dropdown in Backend through 3 steps: Step 1: Declare the Ui component dynamic action Step 2: Declare the Action Resource class Step 3: Declare the mass action in ui_component xml file Magento 2 has supported tree action in the backend […]

Read More

UI Export Button Component in Magento 2

“UI ExportButton Component” is a “Listing/Grid Secondary Component”. It is used to export grid data to specified data format (cvs, xml, and so on). You can take a look at the file \vendor\magento\module-ui\view\base\ui_component\etc\definition.xml

You can use it like:

You can take a look at the file \vendor\magento\module-sales\view\adminhtml\ui_component\sales_order_grid.xml to see it:

The steps […]

Read More