Created
October 2, 2026 06:25
-
-
Save plugin-republic/50dacb10fbaf6b8a4d023c9e9ba38efd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Force Booking products to be treated as shippable (override the plugin's | |
| * hardcoded set_virtual( true ) on WC_Product_Booking), so WooCommerce's own | |
| * shipping logic — including the Blocks/Store API checkout, which doesn't | |
| * reliably respect the bfwc_hide_shipping_fields filter — sees them as | |
| * non-virtual and shows shipping fields. | |
| */ | |
| add_filter( 'woocommerce_product_get_virtual', 'my_bfwc_booking_not_virtual', 10, 2 ); | |
| add_filter( 'woocommerce_product_variation_get_virtual', 'my_bfwc_booking_not_virtual', 10, 2 ); | |
| function my_bfwc_booking_not_virtual( $virtual, $product ) { | |
| if ( 'simple_booking' === $product->get_type() ) { | |
| return false; | |
| } | |
| return $virtual; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment