Flatsome and Angelleye

128 views Asked by At

I'm trying to figure out how to move the Error messages from above the breadcrumbs on the Checkout page to just above the Billing form. enter image description here I'm using the Angelleye Paypal Express Plugin with Flatsome. I'm doing my changes on the function.php of the child theme. I have this code in the Error.php from /notices/woocommerce

<ul class="woocommerce-error message-wrapper" role="alert">
<?php foreach ( $notices as $notice ) : ?>
    <li<?php echo wc_get_notice_data_attr( $notice ); ?>>
        <div class="message-container container alert-color medium-text-center">
            <span class="message-icon icon-close"></span>
            <?php echo wc_kses_notice( $notice['notice'] ); ?>
        </div>
    </li>

I have deleted the code for testing and the issue was gone, however, I would like to place it above the Billing details if possible. Around the

<div class="woocommerce-notices-wrapper"</div>

Any thoughts? Thanks

1

There are 1 answers

3
M Mainul Hasan On

Please place your code in functions.php. Tweak the code if needed. Not tested, believe it will work.

add_action( 'woocommerce_before_checkout_form', 'woocommerce_output_all_notices', 10 );

function woocommerce_output_all_notices() { ?>
<div class="woocommerce-notices-wrapper"
    <ul class="woocommerce-error message-wrapper" role="alert">
        <?php foreach ( $notices as $notice ) : ?>
            <li<?php echo wc_get_notice_data_attr( $notice ); ?>>
                <div class="message-container container alert-color medium-text-center">
                    <span class="message-icon icon-close"></span>
                    <?php echo wc_kses_notice( $notice['notice'] ); ?>
                </div>
            </li>
        <?php endforeach; ?>
        </ul>
    </div
<?php    
}