I need to adding to cart woocommerce booking product, if i writing this code, i have false
Or where normal documentation for this plugin?
global $woocommerce;
$added = $woocommerce->cart->add_to_cart($product_id);
I need to adding to cart woocommerce booking product, if i writing this code, i have false
Or where normal documentation for this plugin?
global $woocommerce;
$added = $woocommerce->cart->add_to_cart($product_id);
2
Answers
As, per my understanding i think bookable products meant to be book only.
For that what you need to do is use this piece of code to do this pragmatically.
1 Product ID: The id of the bookable product which you are creating a new booking for.
2.New Booking data: Array of booking data.
3.Status: Status of the new booking. Valid statuses include: ‘unpaid’, ‘pending’, ‘confirmed’, ‘cancelled’, ‘complete’
4.Exact: true or false – If false, the function will look for the next available slot after your start date, if the date you tried to book is unavailable.