I would like to change the position of all the coupon code-related WooCommerce messages on the checkout page.
I have successfully moved the coupon code form from its original position (top of the checkout page) to after the order details table (woocommerce_review_order_before_payment
hook).
But now the coupon code message placement does not make sense, especially for mobile users, therefore I would like to move all of the coupon code-related messages below the coupon form (at the woocommerce_review_order_before_payment
hook).
However, it's important that only messages that are related to coupon codes get moved and not all of the messages.
Here's a list of all the WooCommerce messages that are related to coupon codes:
Message | Message type | When |
---|---|---|
Coupon code already applied! | woocommerce-error |
When you try applying a coupon code that has already been applied to your order. |
Coupon "coupon-code" does not exist! | woocommerce-error |
When you try applying a nonexistent coupon code. |
Please enter a coupon code. | woocommerce-error |
When you try applying an empty coupon field. |
Coupon has been removed. | woocommerce-message |
When you successfully remove a coupon code from your order. |
Coupon code applied successfully. | woocommerce-message |
When you successfully apply a coupon code to your order. |
Could someone please help out?