Add a new product type in Magento 2

Magewallet | Magento 2 Extensions, Themes & Solutions

Add a new product type in Magento 2

Happy to see you guys again!

In this Magento 2 Tutorial, we will learn how to Add a new product type in Magento 2 step by step using one real extension. As you know, Magento 2 store comes with six different product types.

  • Simple product
  • Configurable product
  • Grouped product
  • Bundle product
  • Downloadable product
  • Virtual products

These are all product types available in Magento Community out of the box. In this blog post we will learn how to create custom product type in Magento 2 using extension. We will create “Digital Product” type with this blog post step by step.

Lets consider module with Namespace is Magewallet and Module Name is DigitalProduct. Lets list down all the files require for this extension.


First we will create registration file at app/code/Magewallet/DigitalProduct/registration.php file

Now, create a composer.json file in app/code/Magewallet/DigitalProduct/ folder as per below.

now create module.xml file in app/code/Magewallet/DigitalProduct/etc

now create product_types.xml file in app/code/Magewallet/DigitalProduct/etc

Create a setup file in app/code/Magewallet/DigitalProduct/Setup/InstallData.php

Create Model file app/code/Magewallet/DigitalProduct/Model/Product/Type/Digital.php

Create Price Model file app/code/Magewallet/DigitalProduct/Model/Product/Type/Digital.php

Thats it.

Active Magewallet_DigitalProduct extension

Open Command line in folder root of Magento and run commands

Now you can check new product type at backend panel by adding new product. You will get more ideas from this screenshots.

Select New Product Type Magento 2

Select New Product Type Magento 2

Digital Product in Grid

Digital Product in Grid

Add New Digital Product

Add New Digital Product

If you have any questions about this Magento 2 Tutorial, please ask them in comments.
Enjoy Magento 2! Enjoy Magewallet!!


Leave Comment


Latest Tweets