woo specific category products loop – hide add to cart button
-
Hello, could you please help me to write a function to remove potter woo add to cart button from specficic category?
I was able to add the code that hides the button for product detail – thats woocommerce function:function remove_product_description_add_cart_button(){
global $product;// Set HERE your category ID, slug or name (or an array)
$category = ‘predplatne-pro-skoly’;//Remove Add to Cart button from product description of product with id 1234
if ( has_term( $category, ‘product_cat’, $product->id ) )
remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 );}
add_action(‘wp’,’remove_product_description_add_cart_button’);Could you advice how to hide it using potter add to cart button in category loop? thanks
- The topic ‘woo specific category products loop – hide add to cart button’ is closed to new replies.