Hide add to cart on grouped products....

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
You can hide the add to cart button using the code in woocommerce.php (located wp-content/plugins/woocommerce)

  
 function WpBlog() {
    remove_action( 'woocommerce_after_shop_loop_item',
    'woocommerce_template_loop_add_to_cart');
    remove_action( 'woocommerce_single_product_summary',
    'woocommerce_template_single_add_to_cart');
    return WooCommerce::instance();
    }


For specific product add the code in functions.php

add_filter('woocommerce_is_purchasable', 'wpblog_specific_product');
function wpblog_specific_product($purchaseable_product_wpblog, $product) {
return ($product->id == specific_product_id (512) ? false : $purchaseable_product_wpblog);
}


Reference: https://www.wpblog.com/add-to-cart-button-in-woocommerce-store/
6 years ago
alexanderbiscajin wrote:
You can hide the add to cart button using the code in woocommerce.php (located wp-content/plugins/woocommerce)

  
 function WpBlog() {
    remove_action( 'woocommerce_after_shop_loop_item',
    'woocommerce_template_loop_add_to_cart');
    remove_action( 'woocommerce_single_product_summary',
    'woocommerce_template_single_add_to_cart');
    return WooCommerce::instance();
    }


For specific product add the code in functions.php

add_filter('woocommerce_is_purchasable', 'wpblog_specific_product');
function wpblog_specific_product($purchaseable_product_wpblog, $product) {
return ($product->id == specific_product_id (512) ? false : $purchaseable_product_wpblog);
}


Reference: https://www.wpblog.com/add-to-cart-button-in-woocommerce-store/


Hi,

I think you mistakenly replied with wooCommerce answer.. :))
5 years ago
Hope It Will Help you!

function WpBlog() {
    remove_action( 'woocommerce_after_shop_loop_item',
    'woocommerce_template_loop_add_to_cart');
    remove_action( 'woocommerce_single_product_summary',
    'woocommerce_template_single_add_to_cart');
    return WooCommerce::instance();
    }


For specific product add the code in functions.php

add_filter('woocommerce_is_purchasable', 'wpblog_specific_product');
function wpblog_specific_product($purchaseable_product_wpblog, $product) {
return ($product->id == specific_product_id (512) ? false : $purchaseable_product_wpblog);
}


Regards, Hashtag Blogging
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.