Pass date variable via URL + Get current date selection
-
Hi,
We are trying to add a product by url or via the function WC()->cart->add_to_cart.– So, firstly by url we need to know how to pass the date. We tried with this variable: “start_date=2018-07-13” but it’s not working.
(Sample >> ?add-to-cart=707&variation_id=2137&attribute_pa_person=adults&attribute_pa_hours=2-hrs-trip-at-400-pm-only-friday&start_date=2018-07-13)– Similar to this, we need to add another product with the same date selected for the current product. But how to pass the date in this kind of function??
$product_id = $product->get_id();
$quantity = 1;
$variation_id = 2138;
$variation = array(
‘Person’ => ‘Children’,
‘Hours’ => ‘2 Hours’,
);
$easy_booking_date = (((how to get current selection????)))
WC()->cart->add_to_cart( $product_id, $quantity, $variation_id, $variation, ???);Thanks in advance.
- The topic ‘Pass date variable via URL + Get current date selection’ is closed to new replies.