PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.27
Booktics – Appointment Booking Calendar for Service Businesses v1.0.27
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 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.2 1.0.3 All 31 releases
← All changes | core/cart/cart-manager.php +4 -5 trunk → 1.0.27 View file →
@@ -121,10 +121,8 @@
121 121 }
122 122 }
123 123 }
124 124 $cart = count( $carts ) ? $carts[0] : array();
125 - // Session cart items always carry subtotal/total keys, set to 0 when none was stored.
126 - $subtotal = ! empty( $item['subtotal'] ) ? $item['subtotal'] : ( $item['price'] ?? 0 );
127 125 $cart_item_data = array(
128 126 'uuid' => $item['uuid'],
129 127 'cart_id' => $cart->id,
130 128 'team_member_id' => $item['team_member_id'],
@@ -132,10 +130,10 @@
132 130 'date' => $item['date'],
133 131 'start_time' => $item['start_time'],
134 132 'end_time' => $item['end_time'],
135 133 'price' => $item['price'] ?? 0,
136 - 'subtotal' => $subtotal,
137 - 'total' => ! empty( $item['total'] ) ? $item['total'] : $subtotal,
134 + 'subtotal' => $item['subtotal'] ?? $item['price'],
135 + 'total' => $item['total'] ?? $item['subtotal'],
138 136 'additional_duration_id' => booktics_sanitize_id_string( $item['additional_duration_id'] ?? '' ),
139 137 'created_at' => current_time( 'mysql' ),
140 138 'updated_at' => current_time( 'mysql' ),
141 139 );
@@ -287,9 +285,10 @@
287 285 * @return array Updated item data or empty array if item not found
288 286 */
289 287 public function edit_cart_item( string $uuid, array $new_data ): array {
290 288 if ( ! is_user_logged_in() ) {
291 - $cart = Cart_Session::edit_item( $uuid, $new_data );
289 + Cart_Session::edit_item( $uuid, $new_data );
290 + $cart = Cart_Session::get();
292 291 foreach ( $cart['items'] as $item ) {
293 292 if ( $item['uuid'] === $uuid ) {
294 293 return $item;
295 294 }