I'm trying to create a custom variable product type from woocommerce for a booking form, which has different pricing based on a set of variables.
I've successfully added a custom product type. But how do i duplicate the same option that the variable product has for different attribute pricing. Can't seem to find any resources related with variable product types.
// add a product type
add_filter( 'product_type_selector', 'cpt_add_custom_product_type' );
function cpt_add_custom_product_type( $types ){
$types[ 'booking_product' ] = __( 'Booking Product' );
return $types;
}
add_action( 'plugins_loaded', 'cpt_create_custom_product_type' );
function cpt_create_custom_product_type(){
// declare the product class
class WC_Product_Wdm extends WC_Product_Variable {
public function __construct( $product ) {
$this->product_type = 'booking_product';
parent::__construct( $product );
// add additional functions here
}
}
}