add_action( 'woocommerce_before_checkout_form', array( &$this, 'wc_add_notice_free_shipping' ) );
function wc_add_notice_free_shippin_checkout() {
            $free_shipping_settings = get_option('woocommerce_free_shipping_1_settings');
            $amount_for_free_shipping = $free_shipping_settings['min_amount'];
            $cart = WC()->cart->subtotal;
            $remaining = $amount_for_free_shipping - $cart;
            if( $amount_for_free_shipping > $cart ){
                $notice = sprintf( "Add %s worth more products to get free shipping", wc_price($remaining));
                wc_print_notice( $notice , 'notice' );
            }
            
}
Geef een reactie 0