Move WooCommerce Notices
March 21, 2025 · AI Conversations
Here’s how you can do it:
### Step 1: Remove the default notices from their original position
In your theme’s `functions.php` or a custom plugin, add the following code:
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_notices', 10 );
### Step 2: Re-add them to the top of the checkout form
Then, re-add the notices at the very top of the form using:
add_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_notices', 1 );
### Full code snippet:
add_action( 'init', function() {
// Remove default checkout notices position
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_notices', 10 );
// Add checkout notices to top of form
add_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_notices', 1 );
});
### Optional: Add custom styling (if needed)
If you also want to ensure styling is correct, you can add custom CSS:
.woocommerce-NoticeGroup-checkout {
margin-bottom: 20px;
}
Let me know if you'd like this only on specific pages or under specific conditions (like AJAX errors only)!
we may need to our ips to sagepay
Also I assume this will not a issue on live server
Correct above sentence
—
**Sorry for the delay. We are currently working on our demo server to resolve some code-related issues. You are right — our server IPs are currently blocked by Sage Pay. We may need to whitelist our IPs with Sage Pay.**
**Also, I assume this issue will not occur on the live server.**
—
Let me know if you'd like to make it more formal or casual depending on your audience.