diff --git a/changelog/fix-bookings-id-undefined-variable b/changelog/fix-bookings-id-undefined-variable new file mode 100644 index 00000000000..04066ac1349 --- /dev/null +++ b/changelog/fix-bookings-id-undefined-variable @@ -0,0 +1,5 @@ +Significance: patch +Type: fix +Comment: Small defensive check for booking_id variable. + + diff --git a/includes/express-checkout/class-wc-payments-express-checkout-button-helper.php b/includes/express-checkout/class-wc-payments-express-checkout-button-helper.php index 4c42635d102..c5194b5a888 100644 --- a/includes/express-checkout/class-wc-payments-express-checkout-button-helper.php +++ b/includes/express-checkout/class-wc-payments-express-checkout-button-helper.php @@ -109,7 +109,7 @@ public function ajax_add_to_cart() { $data += $this->build_display_items(); $data['result'] = 'success'; - if ( $booking_id ) { + if ( ! empty( $booking_id ) ) { $data['bookingId'] = $booking_id; }