I am using the code below to remove other WooCommerce product category items from the cart when there is an item with a special product category \'cat_x\' added in cart and
I just tried and i got a syntax error the array that i fixed this way:
$terms_slugs = wp_get_post_terms($product_id, 'product_cat', array('fields' => 'slugs'));
just a comma after product_cat distraction, but maybe somebody would need it.