diff --git a/src/BlockTypes/Checkout.php b/src/BlockTypes/Checkout.php index 91db65a3d7a..e93a0544424 100644 --- a/src/BlockTypes/Checkout.php +++ b/src/BlockTypes/Checkout.php @@ -255,7 +255,9 @@ function() { $this->asset_data_registry->add( 'hasDarkEditorStyleSupport', current_theme_supports( 'dark-editor-style' ), true ); $this->asset_data_registry->register_page_id( isset( $attributes['cartPageId'] ) ? $attributes['cartPageId'] : 0 ); - $local_pickup_enabled = filter_var( get_option( 'woocommerce_pickup_location_settings' )['enabled'], FILTER_VALIDATE_BOOLEAN ) ?? false; + $pickup_location_settings = get_option( 'woocommerce_pickup_location_settings', [] ); + $local_pickup_enabled = wc_string_to_bool( $pickup_location_settings['enabled'] ?? 'no' ); + $this->asset_data_registry->add( 'localPickupEnabled', $local_pickup_enabled, true ); $is_block_editor = $this->is_block_editor();