MainWP Community

Move Coupon Field Before Subtotal on Checkout in WooCommerce

Move the coupon field before subtotal on check if using WooCommerce on your child site.

Snippet Type

Execute on Child Sites

Snippet

remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
add_action( 'woocommerce_review_order_after_cart_contents', 'woocommerce_checkout_coupon_form_custom' );
function woocommerce_checkout_coupon_form_custom() {
    echo '<tr class="coupon-form"><td colspan="2">';
    
    wc_get_template(
        'checkout/form-coupon.php',
        array(
            'checkout' => WC()->checkout(),
        )
    );
    echo '</tr></td>';
}
1 Like

Example.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.