• Resolved vincentdemeulenaere

    (@vincentdemeulenaere)


    Im trying to make a new Custom Product Type, but I want it to have the same base functionalities as a Bookable Product from the WC Bookings plugin. I know I can create a new product type with following code:

    function wp2_register_group_activity_product_type () {
    
        class WC_Group_Activity extends WC_Product {
    
            public function __construct( $product ) {
                $this->product_type = 'group_activity'; // name of your custom product type
                parent::__construct( $product );
                // add additional functions here
            }
        }
    }

    But following code does not seem to work:

    class WC_Group_Activity extends WC_Product_Booking {

    Any help or direction is appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Daniyal Ahmed (a11n)

    (@daniyalahmedk)

    Hi there,

    Thanks for reaching out.

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Best,

    Seems we’ve not had additional inputs on this thread. Thus, we encourage you to make use of the above resources.

    I’ll go ahead and mark the thread as resolved but please feel free to create a new thread if you have further questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Create Custom Product Type extend WC_Booking’ is closed to new replies.