0

In Demandware, when a store has been added to the system, the default store image appears broken. I have heard that there is a way to upload a default image so that this is used as the default.

Can someone please point me in the direction of either documentation on the topic or let me know how this can be done.

Thanks in advance, Tristam.

2 Answers2

1

I believe this is not about the actual Store object but it's about the product images. Since there's no "default store image" in Demandware, this is the most reasonable deduction imho.

large medium small

So, if you need to show a default image, which is above, you need to is using an if condition in your template:

<isset name="Product" value="${pdict.Product}" scope="page" />

<!-- stuff -->

<isif condition="${!empty(Product.getImage('hi-res', 0))}">
    <isset name="imageURL" value="${Product.getImage('hi-res', 0).getURL()}" scope="page" />
<iselse/>
    <isset name="imageURL" value="${dw.web.URLUtils.staticURL('/images/noimagelarge.png')}" scope="page" />
</isif>

<!-- stuff -->

<img src="${imageURL.toString()}" alt="Product image or default image" />

You can also check out /app_storefront_core/cartridge/templates/default/product/components/productimages.isml file for the usage. Do not forget to adjust your sizes (hi-res and noimagelarge) according to your settings.

Gökay Gürcan
  • 1,082
  • 1
  • 10
  • 25
0

If the image of a store is broken in the frontend it is likely that you do have the image attribute set but the image is not uploaded (to the right location) and thus you end up with a reference that cannot be resolved.

SGD
  • 1,676
  • 14
  • 18