Automattic\WooCommerce\Blocks\Domain\Services\OnboardingTasks
ReviewCheckoutTask::has_checkout_block()
Check if the store uses blocks on the cart or checkout page.
Method of the class: ReviewCheckoutTask{}
No Hooks.
Return
true|false
.
Usage
// private - for code of main (parent) class only $result = $this->has_checkout_block();
ReviewCheckoutTask::has_checkout_block() ReviewCheckoutTask::has checkout block code WC 9.2.3
private function has_checkout_block() { $cart_page_id = wc_get_page_id( 'cart' ); $has_block_cart = $cart_page_id && ( has_block( 'woocommerce/cart', $cart_page_id ) || has_block( 'woocommerce/classic-shortcode', $cart_page_id ) ); return $has_block_cart; }