Hello team,
I need your help. I’m using the theme Sense in one of my stores and I can’t set a picture to default in one of my products with variants.
When I enter in the product webpage, the first variant is selected.
Thanks you all!
A Shopify store owner using the Sense theme is experiencing an issue where product detail pages display the first variant’s image instead of the designated default product image, even though the default image is correctly set in the product section.
The Problem:
Troubleshooting Steps Taken:
featured_media variableCurrent Status:
Hello team,
I need your help. I’m using the theme Sense in one of my stores and I can’t set a picture to default in one of my products with variants.
When I enter in the product webpage, the first variant is selected.
Thanks you all!
Hey!
Thanks for your answer but that is not the problem.
I have a product, I already set this “picture 1” as default on the product section. When in enter to the product website, “picture 2” is showed (the first variant). This happens because this one is the default variant selected (for example “blue”).
Thanks again.
Hi @CheloChamorro ,
Please send me the code of product-media-gallery.liquid file, I will check and guide it for you
Hi @namphan ,
Here is. Thanks!
Hi @CheloChamorro ,
I tested and the code works fine.
Please send the website link, I will check it for you
Hi,
Is petbaggies.store
Thanks for the reply but the problem is not that.
I have a product “a” with some pictures, one of them is a young man modeling it, this product also have some variants. If i enter the main products page, the main picture of this product is showed (good) but when i enter the product detailed website, the first picture showed is the first variant of this one and this happens because by default a variant is already selected.
I just want to enter the datailed product website and see the default picture, not the variant even when this is selected, so you will need to clic on this one again or maybe the variant selection option is not focused on the first one.
Thanks!
Hi @CheloChamorro ,
Please change all code:
{% comment %}
Renders a product media gallery. Should be used with 'media-gallery.js'
Also see 'product-media-modal'
Accepts:
- product: {Object} Product liquid object
- variant_images: {Array} Product images associated with a variant
- limit: {Number} (optional) When passed limits the number of media items to render
Usage:
{% render 'product-media-gallery' %}
{% endcomment %}
{%- liquid
if section.settings.hide_variants and variant_images.size == product.media.size
assign single_media_visible = true
endif
if limit == 1
assign single_media_visible = true
endif
assign media_count = product.media.size
if section.settings.hide_variants and media_count > 1 and variant_images.size > 0
assign media_count = media_count | minus: variant_images.size | plus: 1
endif
if media_count == 1 or single_media_visible
assign single_media_visible_mobile = true
endif
if media_count == 0 or single_media_visible_mobile or section.settings.mobile_thumbnails == 'show' or section.settings.mobile_thumbnails == 'columns' and media_count < 3
assign hide_mobile_slider = true
endif
if section.settings.media_size == 'large'
assign media_width = 0.65
elsif section.settings.media_size == 'medium'
assign media_width = 0.55
elsif section.settings.media_size == 'small'
assign media_width = 0.45
endif
assign featured_media = product.featured_media
-%}
Hi @CheloChamorro ,
Can I send you a collaborator invitation? It will help me check things better.
Yeah of course… What do you need?
Hi @CheloChamorro ,
Please send me the collaborator code in private message, I will send you the invitation and check it