Tag: Magento 2 Tutorials (page 1 of 10)

Magento 2 – How to Add Admin Menu

In this post I am going to explain How to add Admin Menu in Magento 2 In Magento 2, we use the menu.xml to add the menu. Follow the steps to create Admin Menu in Magento 2. Step 1: Create menu.xml on below path and add the below content. Path: app/code/<vendor>/<module>/etc/adminhtml/menu.xml

Step 2: Add…

How to Get Customer Data By Customer Email in Magento 2

In this post I am going to explain how to get customer data by customer email Magento 2. Using below code snippet you can get customer data by passing customer email and website id. Add below code snippet in Block class.

Add below code snippet in template file.

That’s it. Enjoy Magento 2!!…

Magento 2 – How to get Magento 2 Edition and Version

In this post I am going to explain how to get Magento 2 edition and version. 1. Using Dependency Injection Add below code snippet in Block class.

Add below code snippet in template file.

2. Using Object Manager

It will return edition name like Community or Enterprise and the version like 2.3.5-p1….

Magento 2 – How to Create and Call Modal Popup Widget

In this post I am going to explain how to create and call modal popup widget in Magento 2. First, you need to create a “mymodal.js” file at below path. Path: app/code/<vendor>/<module>/view/frontend/web/js/mymodal.js  

  After creating js file, create a “requirejs-config.js” at file below path and add/call js in it. Path: app/code/<vendor>/<module>/view/frontend/requirejs-config.js  

Magento 2 – How to Get Customer Data By Customer ID

In this post I am going to explain how to get customer data by customer id Magento 2. Using below code snippet you can get customer data by passing customer id. Add below code snippet in Block class.

Add below code snippet in template file.

  Team HiddenTechiesWrite an article about ecommerce that…

Magento 2 – How to Disable Payment Method Programmatically

In this post I am going to explain how to disable payment method programmatically in magento 2. First, We need to write the “payment_method_is_active” event, which checks on checkout for payment method availability. So, we are going to create event.xml file on below path. Path: app/code/Ht/Mymodule/etc/

Next to that, we are going to create…

Magento 2 – How to Add Dependant Field in Admin System Configuration

In this post I am going to explain how to add dependant field in admin system configuration in magento 2. In order to create a field dependant on single value, use the below code:

And to create a field dependant on two or more values, use the below code:

Here is the example…

Magento 2 – How to Add Customer Address Programmatically

In this post I am going to explain how to add customer address programmatically in magento 2. 1. Using Dependency Injection Add below code snippet in Block class.

  2. Using Object Manager  

  Thats it. Enjoy Magento 2!! Team HiddenTechiesWrite an article about ecommerce that help people to grow their ecommerce…

Magento 2 – How to Add Date Picker in Custom Form

In this post I am going to explain how to add date picker in custom form. Date Field HTML:

Add the below script to apply the date picker to the field.

Thats it. Enjoy Magento 2!! Team HiddenTechiesWrite an article about ecommerce that help people to grow their ecommerce business. You’ll find best…

Magento 2 – How to Create Customer Programmatically

In this post I am going to explain how to create customer programmatically in magento 2. 1. Using Dependency Injection Add below code snippet in Block class.

2. Using Object Manager

Note: After creating customer you need to run indexer command to see a customer in the backend grid.

That’s it. Enjoy…

Older posts