Shopify / shopify-app-bridge

https://shopify.dev/docs/api/app-bridge
82 stars 9 forks source link

shopify.resourcePicker displays variants despite choosing type="product" #348

Open ybouane opened 1 month ago

ybouane commented 1 month ago

Describe the bug

When calling:

const selection = await shopify.resourcePicker({
  type      : 'product',
  multiple      : true,
});

The modal that shows up allows selecting both products and variants which is undesired. I only want the user to select products, not specific variants.

To Reproduce

Use the code provided and you'll get a window like this:

image

Expected behaviour

Variants should be selectable when type == variant not product.

Contextual information

"@shopify/app-bridge-react": "^4.1.3", "@shopify/polaris": "^12.0.0", "@shopify/app-bridge-types": "^0.0.13",

Additional context

Using the remix template.

fabregas4 commented 1 month ago

Add filter: { variants: false } to the config