{"id":231,"date":"2018-11-09T12:26:40","date_gmt":"2018-11-09T12:26:40","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2018\/11\/09\/create-custom-product-type-in-magento-2\/"},"modified":"2025-07-23T17:23:44","modified_gmt":"2025-07-23T11:53:44","slug":"create-custom-product-type-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/create-custom-product-type-in-magento-2\/","title":{"rendered":"How to Create Custom Product Type in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2 supports 6 product types by default:&nbsp;Simple Product, Grouped Product Configurable Product, Bundle Product, Virtual Product, and Downloadable Product. These product types, each having its own features, enables Magento 2 to support a wide range of industries.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, owing to diverse Magento areas, the need may arise to&nbsp;<i><strong>create custom product type in Magento 2<\/strong><\/i>&nbsp;to satisfy the requirements of the store to implement specific features.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Magento 2 allows customization to create your own complete new Magento 2 product type! Isn\u2019t it a powerful feature for the developer?&nbsp;?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No worries now when a client comes with weird requirements that the default product types can\u2019t fulfill because now you are going to learn the easy method to&nbsp;<i><strong>create custom product type in Magento 2<\/strong><\/i>. Yaay!&nbsp;?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Create Custom Product Type In Magento 2:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create a&nbsp;<strong class=\"\">product_types.xml<\/strong>&nbsp;file in&nbsp;<strong>etc<\/strong>&nbsp;folder<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?xml version=\"1.0\"?>\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Catalog:etc\/product_types.xsd\">\n    &lt;type name=\"generic\" label=\"Generic Product\" modelInstance=\"Vendor\\Extension\\Model\\Product\\Type\\Generic\" indexPriority=\"100\" sortOrder=\"10\">\n        &lt;customAttributes>\n            &lt;attribute name=\"refundable\" value=\"true\"\/>\n        &lt;\/customAttributes>\n    &lt;\/type>\n    &lt;composableTypes>\n        &lt;type name=\"generic\" \/>\n    &lt;\/composableTypes>\n&lt;\/config><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create&nbsp;<strong>Generic.php<\/strong>&nbsp;at&nbsp;<strong>Model\/Product\/Type\/&nbsp;<\/strong>directory<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">namespace Vendor\\Extension\\Model\\Product\\Type;\nuse Magento\\Catalog\\Model\\Product;\nuse Magento\\Catalog\\Model\\Product\\Type\\AbstractType;\nclass Generic extends AbstractType\n{\n    const TYPE_CODE = 'generic';\n    public function deleteTypeSpecificData(Product $product)\n    {\n    }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create&nbsp;<strong>catalog_product_view_type_generic.xml<\/strong>&nbsp;file at&nbsp;<strong>view\/frontend\/layout\/<\/strong>&nbsp;folder<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?xml version=\"1.0\"?>\n&lt;page xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\">\n    &lt;body\/>\n&lt;\/page><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With the above method, you no longer need to turn down the client with limited product types! You can always create one for yourself. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note: When users are creating custom product types, they might encounter issues in the admin panel, such as the <a href=\"https:\/\/meetanshi.com\/blog\/magento-product-save-button-not-working-in-admin-how-to-fix\/\">product save button not working<\/a> make sure you fix all such issues.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank You!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 supports 6 product types by default:&nbsp;Simple Product, Grouped Product Configurable Product, Bundle Product, Virtual Product, and Downloadable Product. These product types, each having&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=231"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":19304,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/231\/revisions\/19304"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}