I want to move the woocommerce error inside my section. How do I do that? Do I have to change anything in template file? For all error message , i want it to appear before “row-wrap” class.
<div class="row">
<ul class="woocommerce-error">
<?php foreach ( $messages as $message ) : ?>
<li><?php echo wp_kses_post( $message ); ?></li>
<?php endforeach; ?>
</ul>
<section class="row-wrap prod-wrap">
<!-- WOOCOMMERCE ERROR appear here -->
<div class="row-inner">
<form action="<?php echo esc_url( WC()->cart->get_cart_url() ); ?>" method="post">
</form>
</div>
</section>
</div>
You can move error message on woocommerce’s checkout page with jQuery:
I use this and work well:
The notices are printed by the
wc_print_notices()
function, which is added by WooCommerce to the following hooks:To move them you must remove them from their existing locations and then add them to a new hook name.