// Woocommerce - Single product page notification add_action( 'woocommerce_share', 'custom_cart_notice' ); // Woocommerce - cart page notification add_action( 'woocommerce_before_cart_table', 'custom_cart_notice' ); // Kadence - side cart notificatin add_action( 'kadence-after-side-cart', 'custom_cart_notice' ); function custom_cart_notice() { $min_amount = 50; //change this to your free shipping threshold $current = WC()->cart->subtotal; if ( $current < $min_amount ) { $added_text = '
Buy ' . wc_price( $min_amount - $current ) . ' worth products more to get free shipping
'; $return_to = wc_get_page_permalink( 'shop' ); $notice = sprintf( '%s%s', $added_text, esc_url( $return_to ), 'Continue shopping
' ); echo $notice; } }