if( in_array( $item['product_id'], $ineligible ) ) { // return false; // } // } // // nothing found return the default value // return $is_available; // } // add_filter( 'woocommerce_shipping_free_shipping_is_available', 'my_free_shipping', 20 ); add_filter( 'woocommerce_package_rates', 'specific_products_shipping_methods', 10, 2 ); function specific_products_shipping_methods( $rates, $package ) { // HERE set the product category in the array (ID, slug or name) $terms = array( 'herinneringsbox' ); $taxonomy = 'product_cat'; // HERE set the shipping methods to be removed (like "fat_rate:5") $method_instances_ids = array('free_shipping:1', 'local_pickup:6', 'local_pickup:7'); $found = false; // Loop through cart items checking for defined product IDs foreach( $package['contents'] as $cart_item ) { if ( has_term( $terms, $taxonomy, $cart_item['product_id'] ) ){ $found = true; break; } } if ( ! $found ) return $rates; // If not found we exit // Loop through your active shipping methods foreach( $rates as $rate_id => $rate ) { // Remove all other shipping methods other than your defined shipping method if ( in_array( $rate_id, $method_instances_ids ) ){ unset( $rates[$rate_id] ); } } return $rates; } Winkel - Suskes Baby & Kinderproducten

Winkel

Home/Winkel

Toont alle 4 resultaten

Sort by:
Shopping Cart
Close

Geen producten in de winkelwagen.