Commercetools Choose Product widget not rendering products

Please fill out as many of the following questions as possible so we can help you promptly! If you don’t know how to answer or it does not apply, feel free to remove it or leave it blank.

Builder content link

Detailed steps to reproduce the bug

  • enable the Commercetools integration
  • add a field to a model and give it a type of Commercetools Product
  • create new Content for that model, and click on the “Choose Product” button

The browser is making a successful REST call to Commercetools to fetch a list of products, and the JSON response returns products, but they’re not rendered in the product selector modal - that remains empty.

Screenshots or video link

It looks like this is because the integration with Commercetools contains a hard-coded locale of ‘en-US’:

I’m using the Commercetools sample data which doesn’t use that locale.

Is the “correct” approach here to fork that plugin, and create a custom plugin that works as needed?

NOTE: I had to post a screenshot of github because this forum won’t let me past a url to the BuilderIO github repo:

1 Like

Hi @JamieWT thanks for reporting looking into this issue and we’ll get back to you.


Released a dev version that accepts the locale as input to unblock you, will push a new version after testing this, thanks again for reporting this issue

1 Like

@JamieWT this is fixed and released to the plugin patch version, please allow some time for the change to propagate, if you’re still running into this try a hard refresh to catch the latest changes.

Thanks for that @aziz . I couldn’t figure out how to find and install a “dev” version of a plugin or the “patched” version - I looked for branches but couldn’t find them.

But I see your fix (github_com/BuilderIO/builder/pull/759/files - it would be great if this forum allowed urls that point to the BuilderIO github repos), and can see the new “locale” field in your code change. Its not showing up in the Commercetools integration settings despite some enabling/disabling and hard reloads.

I’ll check back on this later. Btw, this PR includes:

scopes?: string;
...
`${authUrl}/oauth/token?grant_type=client_credentials&scope=${
        scopes || `view_products:${projectKey}`
}`

but still has

      {
        name: 'scopes',
        type: 'string',
        required: true,
      },

Should “scopes” no longer be mandatory?

Hey @JamieWT, there’s a way to lock down the version,
in the integrations tab: if you scroll all the way down and press advanced configuration

You’ll find a list of the plugins installed, you can lock down the version of the plugin by appending @{{package version}}

Good point, addressed in this pr, thanks for pointing that out