I’m creating a custom WooCommerce product type called bookable_service that should behave exactly like the native variable product type.
What I’ve implemented:
- Created a class
WC_Product_Variable_Bookable_ServiceextendingWC_Product_Variable - Overrode
get_type()to return'variable'in admin, and'bookable_service'on frontend - Registered the type using
product_type_selectorandwoocommerce_product_class - Enabled variation support with
woocommerce_product_type_supports - Injected
'product-type-variable'class into the<body>via admin JavaScript
Problem:
Despite this, the WooCommerce admin UI does not:
- Show the “Used for variations” checkbox
- Show the Variations tab in Product Data
- Allow variation pricing to be added
If I switch the product type to 'variable', everything works fine. But with 'bookable_service', WooCommerce seems to ignore variation logic in the admin.
What I need:
I want WooCommerce to treat bookable_service exactly like a variable product — with full variation UI — but allow me to keep a custom product type for conditional frontend logic.
Is there a clean way to fully replicate Variable Product behavior for a custom product type without overriding WooCommerce templates or JS?
I expected that by extending WC_Product_Variable and returning 'variable' in get_type() during admin, WooCommerce would treat my custom type as variation-compatible. But it seems the admin UI logic is tied to hardcoded type strings.
Looking for a WooCommerce-native way to support full variation functionality in a custom product type.