'Add Woocommerce booking product to cart programmatically
I am trying to programmatically add a booking to the shopping cart. I have been looking into the code for this and have found and tried the following:
Method 1: $woocommerce->cart->add_to_cart( $product_id);
Method 2: WC()->cart->add_to_cart( $product_id );
Neither of which are working for me with the latest release of woocommerce bookings.
The code works for simple products in woocommerce without issue. Any help would be greatly appreciated
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
