Hi,
Do you have the other rates setup so that they only show on the products that are larger/heavy and do not qualify for free shipping?
if so the following code should work, as it hides free shipping when there are other available methods.
http://docs.woothemes.com/document/hide-other-shipping-methods-when-free-shipping-is-available/
That needs to be placed in your themes functions.php file.
Thanks 🙂
Thread Starter
yifa
(@yifa)
Sorry, I’m not quite sure what you mean? All I’ve done is create certain shipping classes, say “heavy”, and attached the shipping class to whatever product is overly heavy.
I do have that code you provided already, and it works well, but that is something different.
So say I have a product that is $599, so obviously it qualifies for the over $100 free shipping. On the cart page, the only option it has is free shipping. So somehow I have to exclude this product from qualifying for free shipping and display a flat rate instead (based on the shipping class I attached).
Hi Yifa, im having this exact same problem…. have you found a way to make this work?
How’s this:
http://bryanheadrick.com/product/woocommerce-disable-free-shipping/
This will automatically disable/hide the free shipping method if any product is in the cart that is in one of the selected shipping classes or product categories
I found a snippet to do this for free simply by adding it to your function.php file:
**
*/ Disable free shipping for select products
*
* @param bool $is_available
*/
function my_free_shipping( $is_available ) {
global $woocommerce;
// set the product ids that are ineligible
$ineligible = array( '14009', '14031' );
// get cart contents
$cart_items = $woocommerce->cart->get_cart();
// loop through the items looking for one in the ineligible array
foreach ( $cart_items as $key => $item ) {
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 );
Replacing the $ineligible array for your product number you will exempt those products from free shipping. Works like a charm.
Found this info here: http://speakinginbytes.com/2013/11/disable-free-shipping-woocommerce/
Very helpful. Hope it helps those that are looking for a free solution.
Hey @palexandra glad you found that info on my blog – and glad it’s helping. 🙂