Resource Picker only with Products

Hello everyone,

I have a problem with the Resource Picker and the “Product” type.

When I select this, all products with variants are displayed, but I only need the products without variants.

Is there any way to change this setting? Currently, I only see the option to select “only” variants, but that’s not what I need.

My Code:

const openProductPicker = async () => {
    const selected = await shopify.resourcePicker({
        type: "product",
        multiple: true,
        selectionIds: selectedProducts.map(p => ({ id: p.id }))
    });
    if (selected) {
        setSelectedProducts(selected.map((p: { id: string; title: string }) => ({
            id: p.id,
            title: p.title
        })));
    }
};

Hi @puppyspike

Try this: **

filter: { variants: false, query: `timestamp:${Date.now()}` }

**

const pickerOptions = {
  type:"product",
  multiple: true,
  filter: { variants: false, query: `timestamp:${Date.now()}` },the list
  selectionIds: type === 'product' ? ids : []
};

const selected = await shopify.resourcePicker(pickerOptions);
1 Like

That worked. I think it’s a bit silly because you want to filter something explicitly, but okay.