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
Leave a Reply
You must be registered and logged in to post a comment.