diff --git a/plugins/woocommerce/changelog/40948-fix-cart-checkout-detection b/plugins/woocommerce/changelog/40948-fix-cart-checkout-detection new file mode 100644 index 00000000000..1ed262abee9 --- /dev/null +++ b/plugins/woocommerce/changelog/40948-fix-cart-checkout-detection @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Fix detection of cart and checkout classic-shortcode blocks in the system status report. \ No newline at end of file diff --git a/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php b/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php index bdc788d1dab..99c9bc3b676 100644 --- a/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php +++ b/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-system-status-v2-controller.php @@ -1388,6 +1388,11 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller { if ( $values['block'] && get_post( $page_id ) ) { $block_required = true; $block_present = WC_Blocks_Utils::has_block_in_page( $page_id, $values['block'] ); + + // Compatibility with the classic shortcode block which can be used instead of shortcodes. + if ( ! $block_present && ( 'woocommerce/checkout' === $values['block'] || 'woocommerce/cart' === $values['block'] ) ) { + $block_present = WC_Blocks_Utils::has_block_in_page( $page_id, 'woocommerce/classic-shortcode', true ); + } } // Wrap up our findings into an output array.