woocommerce – add extra coupon area

I’m using Woocommerce to build a custom webshop.

On the checkout page, i’d like my coupon area to be on the bottom of the page, instead of at the top(which is the default).

Read More

I’ts being called with:

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

In that action, there’s the login and the coupon. I want the login to stay up there and the coupon to get to the bottom. But I dont know where or how to seperate them. Does anybody have an idea?

Thanks!

Related posts

Leave a Reply

1 comment

  1. Change the value of 10 to something “higher” like 20 or 30 (a lower number indicates higher priority). See WordPress Coxed on actions, “Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.”

    You can override in your functions file (recommended).

    remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
    add_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 30 );
    

    Alternatively, you can move the ‘woocommerce_checkout_coupon_form’ to another area (like right now it’s set as ‘woocommerce_before_checkout_form’) by changing the action.

    I’ve also got a reply for a scenario relating to moving elements in a WooCommerce theme here: WooCommerce Product Template