Hello,
I am experiencing the same fatal error. Additionally, this issue prevents me from viewing the payment methods in the WooCommerce settings.
Thank you for your help.
Best regards,
Alexis
Thanks for your help. What I actually need is to detect whether the checkout page contains a checkout block. The issue is that sometimes the woocommerce/checkout block might be wrapped inside another Gutenberg block. Because of this, the function:
WC_Blocks_Utils::has_block_in_page( wc_get_page_id('checkout'), 'woocommerce/checkout' )
fails — it doesn’t search recursively, so it can’t detect the checkout block if it’s nested. That’s why I suggested making the search recursive. Also, I was asking if there’s another function that already performs this kind of recursive check to detect whether the checkout block is present on the checkout page.