Sharing some useful tips, solutions and notes for Geeks.

Sunday, January 1, 2023

How to move Coupon Code to My Order section in Checkout page - Woocommerce

 We can simply move Coupon Code to My Order section of checkout page in Woocommerce using below jQuery script. If you have any doubts, please contact us. Below code will make sure its checkout page.


jQuery Script:


jQuery(document).ready(function ($) {
    if ($('body').hasClass('woocommerce-checkout')) {
    var coupon = $(".checkout_coupon");
    coupon.insertAfter('.shop_table.woocommerce-checkout-review-order-table');   
    var couponHeader = $(".woocommerce-form-coupon-toggle");
    couponHeader.insertBefore('.checkout_coupon');   
    }
});

No comments: