Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Restrict Adding the Variation Price to the Fixed Block Price in WooCommerce Booking and Appointment Plugin?

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.

How to Restrict Adding the Variation Price to the Fixed Block Price in WooCommerce Booking and Appointment Plugin? - Tyche Softwares

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.

How to Restrict Adding the Variation Price to the Fixed Block Price in WooCommerce Booking and Appointment Plugin? - Tyche Softwares


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.

How to Restrict Adding the Variation Price to the Fixed Block Price in WooCommerce Booking and Appointment Plugin? - Tyche Softwares

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.

Browse more in: Code Snippets, WooCommerce Booking & Appointment, WooCommerce How Tos

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
Launch Alert: Flexi BOGO for WooCommerce! Create irresistible holiday discount sales with ease.Learn more
0
Would love your thoughts, please comment.x
()
x