Hi there, we added a custom code to our function.php file to show a notice when there are backorders in the order. (see code below) However, as seen in the image, it is not placed together with other notices and is separated by the coupon field. Is there a way to make the notices not be separated by the coupon field? Thank you.
add_action( ‘woocommerce_before_checkout_form’, ‘backordered_items_checkout_notice’ );
function backordered_items_checkout_notice() {
$found = false;
foreach( WC()->cart->get_cart() as $cart_item ) {
if( $cart_item[‘data’]->is_on_backorder( $cart_item[‘quantity’] ) ) {
$found = true;
break;
}
}
if( $found ) {
wc_print_notice( __(“Please allow 2-3 weeks for the custom order product.”, “woocommerce”), ‘notice’ );
}
}
Attachments:
You must be
logged in to view attached files.