Filter Products Available as WooCommerce Composite Components

Ecommerce image

The WooCommerce Composite Product plugin is an awesome tool for stores that sell products individually that can also be used to make up a set. But if you are running a vendors store, or have shop managers working on the products, then you may want to prevent some products from being available as composite components. Maybe you have one version of a product that is for sale seperately only, and one of the same type of product that is to be part of one or more composites. Well, as you may know the composite component selection is an enhanced select where the users type the first three letters or more for products to show, so this would get confusing in the circumstances I just mentioned.

So, you want to limit the products that users can select as components. And you can do this with a simple filter:

You can see in the above example I am using a meta value to filter the products as that is what my project required, but you could use anything you wanted to filter out products you don’t want coming through in the selector.

Like the code you see here? You can hire me at - a WordPress specialist outsourcing site that vets developers to make sure they are of the highest standard. See all developers you can hire through Codeable here.

Posted in Code Snippets, Guides, Plugins, Woocommerce, Wordpress.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.