How to Enable Shopping for Specific Products in WooCommerce

Published: July 27, 2026 Author: TechnoCrackers
How to Enable Shopping for Specific Products in WooCommerce

WooCommerce gives you complete control over how customers purchase products on your online store. In some cases, you may want certain products to be available for purchase while preventing others from being added to the cart. This can be useful for products that require a custom quote, are temporarily unavailable, are sold only through distributors, or are displayed for catalog purposes.

In this guide, we’ll show you several ways to enable shopping for specific products in WooCommerce while restricting purchasing for others.

Why Enable Shopping for Only Specific Products?

There are many situations where store owners don’t want every product to be directly purchasable. Some common examples include:

  • Selling only selected products online
  • Displaying premium products as “Request a Quote”
  • Showing discontinued products without allowing purchases
  • Restricting products based on customer roles
  • Launching products on a scheduled date
  • Creating a catalog alongside an online store

This flexibility helps improve the customer experience while giving you greater control over your inventory and sales process.

Method 1: Disable Purchasing for Individual Products

WooCommerce allows you to make products unavailable for purchase by changing their inventory settings.

Steps:

  1. Go to Products → All Products.
  2. Edit the product you want to restrict.
  3. Under Product Data, open the Inventory
  4. Enable Manage Stock.
  5. Set the stock quantity to 0.
  6. Check Out of Stock.

Customers will see the product, but they won’t be able to purchase it.

Method 2: Make Only Selected Products Purchasable

If you want only certain products to have an Add to Cart button, you can use custom code.

Example:

add_filter('woocommerce_is_purchasable', 'allow_selected_products_only', 10, 2);

function allow_selected_products_only($purchasable, $product) {

    $allowed_products = array(
        125,
        180,
        225
    );

    if (in_array($product->get_id(), $allowed_products)) {
        return true;
    }

    return false;
}

Note: Replace the product IDs with the IDs of the products you want customers to purchase.

Method 3: Restrict Products by Category

Instead of selecting products one by one, you can allow purchasing only for products in specific categories.

Example:

add_filter('woocommerce_is_purchasable', 'allow_selected_categories', 10, 2);

function allow_selected_categories($purchasable, $product) {

    if (has_term('featured-products', 'product_cat', $product->get_id())) {
        return true;
    }

    return false;
}

This approach is much easier when managing large stores.

Method 4: Use User Roles

WooCommerce also allows developers to restrict purchases based on customer roles.

For example:

  • Dealers can purchase wholesale products.
  • Retail customers can purchase standard products.
  • Guests can only browse products.

This method is commonly used in B2B WooCommerce stores.

Method 5: Use a WooCommerce Plugin

If you prefer not to edit code, several plugins provide purchase restrictions.

Popular options include:

  • Catalog Mode plugins
  • Wholesale Suite
  • Members
  • User Role Editor
  • Request a Quote plugins

These plugins let you control who can purchase products without writing PHP.

Showing a Custom Message Instead of Add to Cart

Rather than simply removing the Add to Cart button, you can display a custom message such as:

  • Contact Us for Pricing
  • Available in Store Only
  • Request a Quote
  • Coming Soon
  • Dealer Exclusive

This provides visitors with clear instructions instead of leaving them confused.

Best Practices

When limiting purchases, keep these recommendations in mind:

  • Clearly explain why a product cannot be purchased.
  • Provide an alternative action such as requesting a quote.
  • Keep product pages visible for SEO benefits.
  • Test purchasing rules after updates.

Organize restricted products using categories or tags.

Common Use Cases

Businesses often enable shopping for only specific products when they:

  • Sell customizable products.
  • Offer seasonal inventory.
  • Manage dealer-exclusive products.
  • Display discontinued items.
  • Launch products gradually.

Operate both online and offline sales channels.

Conclusion

WooCommerce provides multiple ways to control which products customers can purchase. Whether you choose inventory settings, custom code, category-based restrictions, user role permissions, or plugins, you can easily create a shopping experience that fits your business model.

By allowing purchases only for selected products, you maintain better control over inventory, simplify product management, and create a more tailored buying experience for your customers.

Ready to Customize Your WooCommerce Store?

Whether you’re launching a new online store or enhancing an existing one, Technocrackers provides custom WooCommerce development, plugin customization, performance optimization, and ongoing website support.

Contact Technocrackers

today for a free consultation and let’s build a WooCommerce store that drives results.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Limited Time Offer

X

Try a Free 2-Hour Test Task

Experience our quality, speed, and communication on any small WordPress task before you commit. No contract. No cost. No obligation.
[For New Agency Partners]

"*" indicates required fields

Name*
0
Would love your thoughts, please comment.x
()
x