Hello Magento Folks,

Welcome again in the Magento Tutorial series where we are going to learn How to Create a New Product Type in Magento 2 with appropriate codes for it. Learn step by step solution How to Configure Color Swatches in Magento 2 in our most recent published article which will help you in improving your customer experience for your store.


Mainly, there are 6 types of products supported in Magento 2 namely Simple product, Grouped product, Bundle product, Configurable product, virtual product, and Downloadable product. But every time everyone is not satisfied with these products so there is also a feature of creating a new Magento 2 product type. So, for creating your required product type follow the given below steps which will help you thoroughly. Let’s Create It. 

Steps to Create a New Product Type in Magento 2.

Step 1: Generate registration.php file

Setup the app\code\Magecomp\Customproducttype\registration.php file

Generate the app\code\Magecomp\Customproducttype\etc\module.xml

Creating of etc/product_types.xml file is mandatory to identify the model of the new product type

Name: Name for the new product type.

Label: Label which is displayed in the Magento Backend.

Model instance: To support the product type’s attributes

Price Model: To support the charge of the new product type.

Step 2: Now, you have to add the code NewProductType model

Magecomp\Customproducttype\Model\Product\Type\Customproducttype model, that should be based on Magento\Catalog\Model\Product\Type\AbstractType.

After completing this, you can rewrite some functions and implement some changes.

Step 3: Add the Price model

Besides, you can also set the new product type as a multipurpose type with some custom functions after extending the Magento\Catalog\Model\Product\Type\Price class

Step 4: Publish the new Magento 2 Product type

After you publish the new product type you will be completing the creation of product type in Magento 2 and can use it wherever you need. The new published type will also be displayed like the other product types.

Final Words:

Therefore, the above steps will help you in successfully creating the configurable product type in your Magento 2 store.

I hope the explanation was helpful for you and for any queries you face in implementing the above steps feel free to contact MageComp support which will help you. Also, comment down your reviews in the comment section below and also share with your Magento friends and help them in achieving this.

Happy Reading?

Click to rate this post!
[Total: 5 Average: 3.4]