2

I have assigned some images to products in BizFx, but the image always shows up as a toaster on the storefront.

The toaster image belongs to the Habitat sample images, but there doesn't appear to be any references to that item so it's unclear why it's being used.

3

The toaster image is hardcoded (by id!) as a fallback for when the product template does not contain a field named "Images". Not for an empty field value, only when the field missing entirely.

The product fields are all generated when the "Update Commerce Templates" button is clicked in the ribbon. The process involves finding the first entity in the appropriate list and then obtaining a specific view (ConnectSellableItem for products) and using it's properties as fields. Those properties are then used to generate templates in /sitecore/templates/Commerce/Catalog Generated.

In the case of images, it appears that actually having content is necessary to include the field.

So, to resolve:

  • Call GetList(id='SellableItems') ("Lists - Sellable Items" in postman) to find the entity ID of the first SellableItem
  • Open that sellable item in BizFx and assign an image
  • Open Content Editor and click the "Update Commerce Templates" ribbon button
  • Click the "Clear Commerce Cache" ribbon button
  • (If your site is in "web") Publish the /sitecore/templates/Commerce folder

The "Product Images" rendering has caching enabled, so if you haven't set up clear-on-publish for the site you may want to recycle the app pool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.