Move the WooCommerce Coupon Field Above the Payment Methods
Steps to Implement
- Add the code snippet to your website by modifying your theme or using WPCode.
- Copy the form-coupon.php WooCommerce template to your theme.
- Add
<div class="woocommerce-coupon-container">
before the first div tag in the form-coupon.php file. - Add
<div>
after the closing form tag in the form-coupon.php file.
/**
* Move the WooCommerce coupon field above the payment methods.
*/
(function($) {
var coupon = $('.woocommerce-coupon-container'); // The container we added to form-coupon.php.
$(coupon).insertBefore('.woocommerce-checkout-payment');
})(jQuery);