I would like to show to customers the price according to a date range.
In on of my bookable product with date rage pricing I have:
- the base price: 100$ for the first day,
- adds $60 to the base price for two days (in a date range),
- adds 90$ to the base price for three days (in a date range).
And so on…
This is done in the backend of the woocommerce bookable product edit settings page.
My problem is now, that I cannot find those additions (60, 90) anywhere in the database. With:
$product = wc_get_product( $product_id );
$price = $product->get_price();
It only return the base price (100$).
Any help in finding those date range settings somewhere in the database or where woocommerce would calculate this per default is appreciated.
For WooCommerce Bookings you have everything needed in the
WC_Product_Booking
object:Now in the database you can find this data in
wp_post_meta
table under_wc_booking_pricing
meta_key
… So from the product ID you can access it too with:My final solution looks like this: