Hi,
Working with many thousands of products we found that image patterns are lacking a few options. Here's what we need (and use in our current implementations, though the UI only partly supports is):
- Custom fields - {ProductCustomFieldX}
The ability to use product fields for image patterns
- Fall-back options - {ProductCustomFieldX || ProductNumber}
Pick a product custom field for the file naming pattern and if empty pick another field
This is important when we have products where images are shared by multiple products, changing only small technical specs
Think of "bolts" or "bearings". The image might be the same for multiple products and/or variants.
- Variant Property field - {VariantOptionPropertyY}
We use this to set a string on the variant options that would have a reference to a filename
i.e. Red T-shirt in Sizes S, M and L where- T-shirt's custom field value for images = "TSHIRT00GRKR"
- Red's variant option property is called "RJO" (company code for Red)
- Sizes variant options have no property for image files
- Pattern would be {ProductCustomFieldX || ProductNumber}{VariantOptionPropertyY}.jpg
- Would return the same file for all red t-shirts
- Use wildcards for multiple images
Currently we can set multiple image patterns, but images needs to be named accurately. Some customers have a looser association where in code we do something like
{ProductCustomFieldX || ProductNumber}{VariantOptionPropertyY}_*
Thus getting all files that match the pattern (excluding non-image files)
Sometimes the images might be named *_front, *_back, and other times *_1, *_2 - it just works
- Extensionless patterns
Set the ability to find image files, not explicitly jpg
Since the image handler processes the output to be consistent, the input becomes less important
We have found this to be important dealing with 20k products with multiple images per product. When the filename association is set on the product number the UI looks beautiful, but real life scenarios. We need to make the image association more automatic (implicit), rather than manual (explicit) or force the user to render the frontend to ensure the images are properly associated.
Best Regards,
Nuno Aguiar