Firstly you need to follow the basic steps that are used for starting a module:

Step1: Create a vendor folder inside app/code (app is the core folder of Magento)

Folder:- app/code/Pravams (Vendor’s name could be any)

Step2: Create a module folder inside app/code/Pravams


Step3: Now inside Booking create a registration.php file.



Step4: Create a etc folder inside your Module

Folder:- app/code/Pravams/Booking/etc

Step 5: Now again inside etc folder create another file module.xml and write the below written code

Folder:- app/code/Pravams/Booking/etc/module.xml

<?xml version="1.0" encoding="UTF-8"?>

<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Pravams_Booking" setup_version="1.0.2">  

Step6: Create product_type.xml inside etc folder and write below written code

Folder:- app/code/Pravams/Booking/etc/product_type.xml

<?xml version="1.0" encoding="UTF-8"?>

<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd">
    <type name="booking" label="booking" modelInstance="Pravams\Booking\Model\Product\Type\Booking" indexPriority ="60" sortOrder="80" isQty="true">
        <priceModel instance="Pravams\Booking\Model\Product\Price" />

Step7: Create Model folder inside app/code/Pravams/Booking

Folder:- app/code/Pravams/Booking/Model

Step8 Create Product folder inside app/code/Pravams/Booking/Model

Folder:- app/code/Pravams/Booking/Model/Product

Step9: Create Type folder inside app/code/Pravams/Booking/Model

Folder:- app/code/Pravams/Booking/Model/Product/Type

Step10: Now create a Booking.php file inside Type folder

File:- app/code/Pravams/Booking/Model/Product/Type/Booking.php

(After creating the file write the given code)

namespace Pravams\Booking\Model\Product\Type;

class Booking extends \Magento\Catalog\Model\Product\Type\AbstractType {
    const TYPE_ID = 'booking';
     * Delete data specific for this product type
     * @param \Magento\Catalog\Model\Product $product
     * @return void
public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $product) {

public function isVirtual($product) {
        return true;

Step11: Now inside Product folder create a file Price.php

File: app/code/Pravams/Booking/Model/Product/Price.php

namespace Pravams\Booking\Model\Product;
class Price extends \Magento\Catalog\Model\Product\Type\Price


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.