Mailchimp Banner | Q2 2024

added by Latoya

Product Icon

WooCommerce Bookings

by  Woo
Allow customers to book appointments, make reservations or rent equipment without leaving your site.

Developer: need a filter for a Bookable Product’s min_date and max_date

First: It’s great that there are lots of filter hooks throughout this extension (way more than are listed in the documentation). We’re able to use them to tweak functionality in ways that are really specific to our use case.

One great one is the ‘woocommerce_booking_get_availability_rules’, which lets us programatically change a product’s availability on its booking form page based on certain criteria. But we can’t change the earliest and latest available times, which are stored in separate variables (min_date and max_date) from the availability rules array.

I get why this happens: these are calculated on the fly every time a product is viewed, whereas the “rules” only need to be recalculated when the product or resource is changed in the back end.

But conceptually, the min and max start dates are part of the availability rules, and it doesn’t really make sense to be able to filter all the rules except these. Please add a filter for each/both of these! If anyone at Woo wants more details about how I’m trying to use this, feel free to email me.

Author

Current Status

Open

Last updated: March 25, 2015

1 comment

Log in to comment on this feature request.

  1. Yoni says:

    I asked for this via a support ticket and it got added! Thanks!