Default Magento 2 provides 6 product types including simple, grouped, configurable, virtual, bundled and downloadable having unique behaviors and attributes. These standard product types covers majority of the Ecommerce needs by supporting wide range of industry and store owner requirements.
But with the diversity of Ecommerce, there may arise a requirement of unique feature that cannot be served by default product types. Luckily you can extend the default product types with the high level of customization. Sometimes it makes complex to work on and still cannot fulfill the business needs where there arises the need to create custom product type in Magento 2.
Here, I’m going to present complete guide on creating custom product in Magento 2:
- Go to App/code/NameSpace/ModuleName/etc and create product_types.xml file and paste the code below.
1<!--?xml version="1.0" encoding="utf-8"?--> - Now go to App/code/NameSpace/ModuleName/ Model/Product/Type/ and create file Externaltype
12345678910<!--?phpnamespace NameSpace \ ModuleName \Model\Product\Type;class Externaltype extends \Magento\Catalog\Model\Product\Type\AbstractType {public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $product) {}}</pre></li><p>Now it’s your turn to implement this code to better create product and achieve your specific business needs! Try out and let me know through commenting if you have any difficulties.</p><p><a href="https://magecomp.com/hire-magento-developer.html?utm_source=blog&utm_medium=CTA&utm_campaign=mcstdev"><img src="https://magecomp.com/blog/wp-content/uploads/2016/08/CTA_magento-custom-development.jpg" alt="CTA_magento-custom-development" width="669" height="200" class="aligncenter size-full wp-image-927" ?-->