<p>There is no native functionality for this at the current time.</p>

<p>You could write a plugin to extend the Products field-type (which itself extends the base entries field-type) - to provide this filter functionality.  That is you'd add a categories chooser to the field type and then filter the available products using that category in your plugin.</p>

<p><a href="https://pluginfactory.io" rel="nofollow noreferrer">https://pluginfactory.io</a> would get you started on the plugin scaffolding, and I'd look at <code>/craft/plugins/commerce/fieldtypes/Commerce_ProductsFieldType.php</code> and the native Craft categories field type to get started.</p>

CC BY-SA 3.0
2017-06-04T00:01:39.387Z
2017-06-04T04:33:03.677Z
2017-06-04T04:33:03.677Z
Jeremy Daalder
<p>I'm creating a site which has a products section.</p>

<p>I have created an entries section called 'Products'. </p>

<p>I have set up some categories, i.e. 'Category One, 'Category Two', 'Category Three'</p>

<p>I have also created a related entries field so I can related products to each other.</p>

<p>When the client adds a new product in 'Category One', they should only be able to relate entries that are in 'Category Two' or 'Category Three'.</p>

<p>Is there a way that I can restrict the results returned in an entries field in the Control Panel to a specific category?</p>

<entries>
Select Related Entries from a specific category in CP
# Select Related Entries from a specific category in CP

(Asked by: username_0 on 2017-06-03)

I'm creating a site which has a products section.

I have created an entries section called 'Products'.

I have set up some categories, i.e. 'Category One, 'Category Two', 'Category Three'

I have also created a related entries field so I can related products to each other.

When the client adds a new product in 'Category One', they should only be able to relate entries that are in 'Category Two' or 'Category Three'.

Is there a way that I can restrict the results returned in an entries field in the Control Panel to a specific category?

**Tags:** entries


---

## 1 answers

### Answer by username_1 on 2017-06-04. Score: 1

There is no native functionality for this at the current time.

You could write a plugin to extend the Products field-type (which itself extends the base entries field-type) - to provide this filter functionality. That is you'd add a categories chooser to the field type and then filter the available products using that category in your plugin.

<https://pluginfactory.io> would get you started on the plugin scaffolding, and I'd look at `/craft/plugins/commerce/fieldtypes/Commerce_ProductsFieldType.php` and the native Craft categories field type to get started.


---

