Home Forums WoodMart support forum Remove add to cart icon in shop loop for specific categories

Remove add to cart icon in shop loop for specific categories

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #247575

    Mackie
    Participant

    Hi, So I added this code to disable the add to cart button and add a Whatsapp chat button in the place. Replace categoryname with the actual category

    
    add_action( 'woocommerce_single_product_summary', 'extra_button_on_product_page', 22 );
    function extra_button_on_product_page() {
        global $post, $product;
        if ( has_term( 'categoryname', 'product_cat' ) ) {
            add_filter( 'woocommerce_is_purchasable', '__return_false');
            echo do_shortcode('[whatsappsupport number="919999999999" text="Contact us to place the order" text-color="#fff" bg-color="#22c15e" message="Hi Im looking for this product... Need some information regarding the same." ]');
    		echo '<p> &nbsp; </p>';
        }
    }
    

    So this did solve my purpose of disabling the add to cart on the product page but in the shop page when I hover over a product it still shows all the 4 buttons and the add to cart is actually adding to cart.

    Is there a way to disable the add to cart only on this particular category?

    #247729

    Hello,

    As you know the Woocommerce does not provide the option and we do not have a code for that. Our support does not cover Woocommerce customization, please try to find a plugin or workable snippet.

    Best Regards

Viewing 2 posts - 1 through 2 (of 2 total)