I am trying to: create a booking system for equipment rentals.
I have created an "availability" post type, and set it as a child post of woocommerce products post type.
Problem that I am experiencing:
e.g. from tool A we have 500 items.
If saved Tool A in WooCommerce products and set stock to 500. If necessary we could save this in a different (child) post type.
if someone books 100 items for a specific date,
then we need to set a rule or use a post type with 500 - 100 = 400.
Also:
how does it work if we have e.g. 3 bookings:
Total items we have: 500
For one date, 3 bookings:
Booking 1: 100 items
Booking 2: 200 items
Booking 3: 50 items
Still available for that day: 500 - 100 - 200 - 50 = 150
Is this possible with standard Toolset tools or do we need custom php/javascript?
I am thinking, we probably need a script that checks if there already more bookings for that specific day, and save the total number of booked items for that day together.
Is there anyone who has done something similar?
Yes, you will need Custom Code for this.
You store the amount of available things in the WooCommerce Post, and that Post Field you need to update with a value that you calculate given some values set in the Child Post type.
If you use CRED you can use the cred_save_data action to update the parent post, this API will help you to run your Custom Code at the right moment, but the code that does the calculation and such is Custom Code.
https://toolset.com/documentation/user-guides/cred-api/#csd
If you use CRED Commerce with WooCommerce, you can also use the CRED Commerce API that provides some hooks for the Checkout Process with CRED.
But also here, the Code that does your Application logic make work, is custom.
It seems -unfortunately- that for now you need custom programming work which is beyond the scope of our support.
At this point I would suggest you consider contacting one of our certified partners from this link:
https://toolset.com/consultant/
You will get the custom assistance you need to get on with your project.
Maybe this plugin would help you save the struggle of PHP:
https://woocommerce.com/products/woocommerce-bookings/