התראה לקבלת משלוח חינם בדף עגלת הקניות גרסה 2

PHOTO EMBED

Tue May 18 2021 17:12:35 GMT+0000 (Coordinated Universal Time)

Saved by @Shesek #cart #delivery

add_action( 'woocommerce_before_cart', 'computec_shipping_cart_notice' );
  
function computec_shipping_cart_notice() {
  
   $min_amount = 150; //change this to your shipping threshold
   
   $current = WC()->cart->subtotal;
  
   if ( $current < $min_amount ) {

	$added_text = ' אנו מבצעים משלוחים מסכום של 150 ש"ח ומעלה הוסף מוצרים בסך ' . wc_price( $min_amount - $current ) . ' נוספים!';       
	$return_to = wc_get_page_permalink( 'shop' );
	$notice = sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', esc_url( $return_to ), 'המשך בקניות', $added_text );
	wc_print_notice( $notice, 'notice' );
   }
}
content_copyCOPY

קרדיט: שמעון סביר