קוד להצגת הסכום שצריך להוסיף כדי להיות זכאים למשלוח חינם

שימו לב שעדכנו פה 2 קודים – אחד להצגה בעמוד העגלה – ואחד בעמוד הקופה/תשלום.

				
					/**
 * Show notice how much left for free shipping
 */
 
 //cart page
add_action( 'woocommerce_before_cart', 'divine_add_notice_free_shipping' );
function divine_add_notice_free_shipping() {
           
           $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( "הוסיפו %s כדי להיות זכאים למשלוח חינם.", wc_price($remaining));
               wc_print_notice( $notice , 'notice' );
           }
            
}


//checkout page
add_action( 'woocommerce_before_checkout_form', 'divine_add_notice_free_shipping_checkout' );
function divine_add_notice_free_shipping_checkout() {
    $free_shipping_settings = get_option('woocommerce_free_shipping_1_settings');
    $amount_for_free_shipping = $free_shipping_settings['min_amount'];
    $cart = WC()->cart->get_subtotal();
    $remaining = $amount_for_free_shipping - $cart;
    if ( $amount_for_free_shipping > $cart ) {
        $notice = sprintf( "הוסיפו %s כדי להיות זכאים למשלוח חינם.", wc_price( $remaining ) );
        wc_print_notice( $notice , 'notice' );
    }
}
				
			

בדוק גם

התאמת אימיילים של ווקומרס לסלולר/מובייל

    כן זו בעיה ידועה עם Kadence Email Customizer. בשביל שיעבוד לך טוב במובייל …

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *