Skip Navigation

[Resolved] appointment system

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Beda 7 years, 8 months ago.

Assisted by: Beda.

Author
Posts
#426288

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?

#426400

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/

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.