B2C Commerce lets you annotate each image assignment with a combination of relative image path, view type or B2C Commerce variation product, and a localizable alt description and image title. Set those values on one image, or set a catalog pattern that fills them in.
Which Salesforce Commerce Product Do I Have?
Alt text and title come from an explicit image assignment or from a catalog pattern:
- Explicitly define annotations using Business Manager. See Assign Images to Products in B2C Commerce.
- Provide a default rule to define the annotation values (for Alt and title) following a pattern. A rule is based on marker attributes or simple string expressions. To set a catalog-wide pattern, enter text and attribute markers in Default Image Alt and Default Image Title in Configure Catalog Image Settings in B2C Commerce. Set the alt and title for one image in the Alt and Title fields in Assign Images to Products in B2C Commerce.
Alt Text and Title Markers
Salesforce B2C Commerce supports the following attribute markers:
| Marker | Description |
|---|---|
${productname} |
The name of the product or variation in current locale. |
${variationvalue} |
The display value of the related variation attribute in the current locale. If the display value is undefined, it's the value itself. |
${viewtype} |
The viewtype itself. |
Here are some sample rules:
"${productname}"
"${productname} - Large"
"${productname} - ${viewtype}"
When the customer hovers over an image, text such as the following appears:
workboots - small
Alt Text and Title Lookup Order
B2C Commerce annotation lookup uses this fallback mechanism:
| Step | B2C Commerce... |
|---|---|
| The process begins | Tries to get an explicitly defined annotation for the current request locale, for example, "de_DE". |
| The annotation is unavailable | Tries to get an explicitly defined annotation for language, for example, "de". |
| The annotation is unavailable | Tries to get an explicitly defined annotation for lead locale, for example, "default". |
| No explicitly defined annotation is available | Uses the default rule pattern. |
| No default rule pattern is defined | Returns null. |