This code enables you to add the custom HTML before the shipping address block on the WooCommerce checkout page.
You can add any type of content or execute a function using this checkout page hook on your block checkout page.

The code enables you to hook your custom content or function below the contact information block and before the shipping address block.
Add the code to the end of your child themes functions file or custom functionality/code snippets plugin.
add_filter( 'render_block', 'wpsitesdotnet_shipping_method_block', 10, 2 );
function wpsitesdotnet_shipping_method_block( $block_content, $block ) {
if ( isset( $block['blockName'] ) && $block['blockName'] === 'woocommerce/checkout-shipping-method-block' ) {
$content = '<p>Custom HTML Before Shipping Address Block</p>';
return $content;
}
return $block_content;
}
Related Solutions :
- Conditional Fields For Contact Block Using Block Checkout
- Checkout Block Conditional File Upload Based on Payment Option For WooCommerce
- Image Upload For WooCommerce Checkout Page Block
- Custom Order Summary Text for WooCommerce Block Checkout
- Custom Fields for WooCommerce Checkout Blocks
- Add Conditional Field to Order Information Block Using Block Checkout
- Add Field To WooCommerce Checkout Block Address Location Conditionally
- How To Add Custom HTML to Checkout Page Blocks WooCommerce






Leave a Reply