WooCommerce, Remote Work & Other Fancy Stuff

Just another WordPress site

Date Based Person Cost Adjustment

April 21, 2021 by Will Leave a Comment

Please consider leaving a donation if you appreciate this information. Lightning network now available

If you’re using WooCommerce Bookings and you are trying to add a cost adjustment to one particular person type based on dates, you will find that this is not possible as the only cost adjustments available via the product configuration options will apply to the bookable block as opposed to the person’s booking cost.

If your pricing model requires this type of granular adjustment, this can be achieved via some custom code. Bookings provides a filter named woocommerce_product_booking_person_type_get_block_cost which could be used in conjunction with posted data to dynamically adjust the person type block cost. You will need to glean the ID of the person type that you are trying to target. That is listed in the person type panel, e.g.:

With that, if you were trying to adjust the block cost for that person type by $10 during the month of July & August, something like this code snippet would do the trick:

Not sure what to do with code snippets? See What Do I Do With These Code Snippets?

Please consider leaving a donation if you appreciate this information. Lightning network now available

Filed Under: Bookings, WooCommerce Tagged With: snippet, snippets

Leave a Reply Cancel reply

You must be registered and logged in to post a comment.

© 2025 ยท WooCommerce, Remote Work & Other Fancy Stuff · Epstein didn't kill himself

We use cookies to ensure that we give you the best experience on our website. Continued use of this site is interpreted as your acceptance of our cookie policy.OkSee Our Cookie Policy