/**
Theme Name: easy child
Author: easy4host
Author URI: http://www.easy4host.com
Description: Easy is the fastest, fully customizable & beautiful theme suitable for blogs, personal portfolios and business websites. It is very lightweight (less than 50KB on frontend) and offers unparalleled speed. 
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: easy-child
Template: astra
*/

/** Move Coupon**/
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>';
}

// Skip cart and redirect to checkout
add_filter('woocommerce_add_to_cart_redirect', 'skip_cart_redirect_to_checkout');
function skip_cart_redirect_to_checkout() {
    return wc_get_checkout_url();
}