With the fixed block feature available in our Booking and Appointment plugin for WooCommerce, store owners can set a fixed rate for a specific time block. But what happens if the product contains variations? For variations, the pricing often depends on the options chosen by the customer.
In this post, we are going to make sure that if the product has the fixed block pricing feature enabled and configured, then the variation price will not be added to the fixed block price. Let’s dive in and see how this customization is implemented!
Solution: Restrict Adding the Variation Price to the Fixed Block Price in WooCommerce Booking and Appointment Plugin
The code ensures that regardless of which options or variations the customer selects, the booking system will only apply the fixed block price set in the product booking settings when using the Booking and Appointment plugin.
add_filter( 'bkap_allow_variation_price', '__return_false' );
Output
Let’s consider a booking product with variation pricing ranging from $100 to $150, depending on the options selected. In the backend of the plugin, you have set a fixed block pricing of $300 for bookings made on weekends.
Implementing the above code ensures that the booking will only be assigned the fixed block pricing rate of $300, regardless of any other options selected in the variations.
When the code is not implemented, the fixed block pricing is applied along with the variation pricing based on the options chosen by the customer.
The fixed block pricing feature is highly valued by businesses offering temporary services such as construction equipment, party supplies, cars, or apartments. While currently these prices may not be displayed transparently but are added to the total cost, you can explore customizations that will show these fixed block prices on the shop page.