The app bridge resource picker when in ‘product’ mode, has a newish ‘add filter’ UI that lets the user filter products by collections.
When the resource picker is initiated with a filter query, the collection filters no longer work.
Initialising the resource picker without a filter query:
const productPickerSelected = await shopify.resourcePicker({
type: 'product',
action: 'select',
multiple: true,
selectionIds: getInitialSelectionIds(),
filter: {
hidden: true,
variants: true,
archived: false,
},
});
Collection filter works as expected:
Initialising the resource picker with a filter query:
const productPickerSelected = await shopify.resourcePicker({
type: 'product',
action: 'select',
multiple: true,
selectionIds: getInitialSelectionIds(),
filter: {
hidden: true,
variants: true,
archived: false,
query: `bundles:false`,
},
});
Collection filter returns no results:
Expected behaviour
When passing in a filter.query, the additional filters the user applies inside the resource picker UI should apply on top of the filter.query.
In the above example, the product picker should be returning the exact same results.
Additional details
We’re using @shopify/app-bridge-react v4.2.0
Our use case is selecting products for a bundle, so we must filter out all bundle products from being selected by the user (bundles can’t be in bundles).
The example above where items in the collection are showing are not bundles.
Thanks,
Anthony