wc_add_notice does not fire
-
If have added this snippet to function.php. wc_add_notice error fires except with paypal express checkout plugin. Can you please help me?
// Set a minimum amount of oder based on shipping zone before checking out add_action( 'woocommerce_check_cart_items', 'cw_min_num_products' ); // Only run in the Cart or Checkout pages function cw_min_num_products() { if( is_cart() || is_checkout() ) { global $woocommerce; // Set the minimum order amount and shipping zone before checking out $minimum = 150; $county = array('GB'); // Defining var total amount $cart_tot_order = WC()->cart->subtotal; if( $cart_tot_order <= $minimum && in_array( WC()->customer->get_shipping_country(), $county ) ) { // Display error message wc_add_notice( sprintf( '<strong>A Minimum order of € %s is required before checking out.</strong>' . '<br />Current order: € %s.', $minimum, $cart_tot_order ), 'error' ); } }
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘wc_add_notice does not fire’ is closed to new replies.