I'm trying to hide the image in the WooCommerce Cart for certain categories. I found that adding this code removes all thumbnails from the Cart:
add_filter( 'woocommerce_cart_item_thumbnail', '__return_false' );
I'm trying (and failing), to only remove this for certain categories, using the following code.
function WooCartImage($woocommerce_cart_item_thumbnail) {
if ( is_product_category(63) ) {
$woocommerce_cart_item_thumbnail = '__return_false';
}
return $woocommerce_cart_item_thumbnail;
}
add_filter( 'woocommerce_cart_item_thumbnail', 'WooCartImage' );
I'm not sure where I'm going wrong with this and if anyone has a hint, that would be great!