PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.64
Timetics – Appointment Booking Calendar & Scheduling v1.0.64
1.0.64 1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 All 65 releases
← All changes | core/integrations/woocommerce/cart-api.php +11 -2 1.0.62 → 1.0.64 View file →
@@ -98,14 +98,23 @@
98 98
99 99 $meeting_id = (int) $booking->get_appointment();
100 100 $price = (int) $booking->get_total();
101 101
102 + // Hooks::add_product_to_cart() already ran on timetics_after_booking_create and
103 + // stored the meeting details ( date, time, duration, timezone, location ) in this
104 + // session. Keep them - overwriting the whole array would drop them before checkout.
105 + $session_data = WC()->session->get( 'timetics_data' );
106 +
107 + if ( ! is_array( $session_data ) || empty( $session_data['booking_id'] ) || (int) $session_data['booking_id'] !== $booking_id ) {
108 + $session_data = [];
109 + }
110 +
102 111 // Set session for timetics data for woocommerce.
103 - WC()->session->set( 'timetics_data', [
112 + WC()->session->set( 'timetics_data', array_merge( $session_data, [
104 113 'booking_id' => $booking_id,
105 114 'meeting_id' => $meeting_id,
106 115 'price' => $price,
107 - ] );
116 + ] ) );
108 117
109 118 // Remove all items from cart.
110 119 WC()->cart->empty_cart();
111 120