Home Forums WoodMart support forum Custom checkout notice not together

Custom checkout notice not together

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #487029

    chuananz
    Participant

    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.
    #487134

    Hello,

    The checkout is the Woocommerce functionality. I am afraid Woocommerce does not provide such an option. It requires customization and beyond our support policy.

    Best Regards.

Viewing 2 posts - 1 through 2 (of 2 total)