Link images to product variants
How to link product images to specific variants in Shoporama, so the right image is shown when the customer chooses a variant such as a color.
You can link specific images to a product variant, so the right image is shown when the customer chooses, for example, a specific color.

How to link images to variants
- Go to Products and click Edit on the product
- Upload all images to the product (all colors/variants)
- Expand the Product images section
- For each image, use the Link to variant dropdown to choose which variant the image belongs to
- Repeat for each image that should be linked to a variant
- Click Save
How it looks in your store
When a customer chooses a variant (for example the color “Red”), the image gallery automatically switches to show the images linked to the selected variant.
In your theme
Variant images are handled automatically in most themes. If you have a custom theme, you can use:
The variant link is stored on the product, not on the variant itself. So you loop through the product's images and check, image by image, whether it is linked to a specific variant value:
<{foreach $product->getImages() as $image}>
<{$variant_value_id = $image->getVariantAttributeValueId()}>
<{if !$variant_value_id || $variant_value_id == $selected_variant_value_id}>
<img src="<{$image|image:400:400:90}>" alt="<{$product->getTitle()}>">
<{/if}>
<{/foreach}>
An image that is not linked to a variant is always shown (as a default image), while images linked to a specific variant are only shown when that variant is selected.
Tips
- Upload all images first, and link them to variants afterward
- Use the same background on all product images for a professional look
- Images that are not linked to any variant are shown as default images
Edit the image after uploading
Click an image to rotate it, crop it, or set a focal point, without changing your original file. Read more about editing images.
See also: Image quality and image format.
Need help? Contact us at support@shoporama.dk.
Related articles
Product images not importing: causes and fixes
Troubleshooting when product images do not import correctly via CSV import or Import images from URL in Shoporama: URL requirements and how to see...
Images on landing pages
How to upload images to a landing page in Shoporama and show them correctly in your theme with getImages() and getSrc().
Optimize images for mobile with responsive images
A guide to using responsive images with srcset in your Shoporama theme, so mobile users get optimized images.
Related features
Product variant
A product variant is a version of a product in, for example, another size or color. Learn about product variants, stock management, SKUs, and...
Image Archive
Collect all your images in one place. Upload once, organize them in folders, and use them on products, categories, and pages or directly in your text.
Product profiles and variants: set up your product types
Create product profiles, attributes, and variants in Shoporama with their own price and stock, and see what to do when a product has both colors...