How to set product main photo?

7 0 1

Hi everyone!

I want to set the main photo of the product, but when the page with the product opens, the photo of one of the product options opens immediately.


I found such a topic on the forum, my problem is also explained here, but the solution that they offer there does not suit me. the fact is that there they suggest editing product.liquid but in my file there is no that part of the code. I use a non-standard theme.


My product.liquid contains only 12 lines

{% section 'product-template' %}
  // Override default values of shop.strings for each template.
  // Alternate product templates can change values of
  // add to cart button, sold out, and unavailable states here.
  theme.productStrings = {
    addToCart: {{ 'products.product.add_to_cart' | t | json }},
    soldOut: {{ 'products.product.sold_out' | t | json }},
    unavailable: {{ 'products.product.unavailable' | t | json }}
<div id="shopify-ali-review" product-id="{{ }}"> {{ shop.metafields.review_collector.review_code }} </div>

Anyone have any ideas?

Shopify Partner
103 25 29

Please open section "product-template" and try to change two things
1) find this one

 {% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %}

change it to 

{% assign featured_image = product.featured_image %}

 2) find this one 

<option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} value="{{ }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option>

Change it to 

<option value="{{ }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option>

 if still getting the issue then please let me know the theme name, i will give you a correct one

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID:
1 Like
229 1 42

Hi @VishvasMishra I added your code but it's not yet working. My theme is Minimal. 

Fyi, my product template uses a slightly different line:

<option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} data-sku="{{ variant.sku }}" value="{{ }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option>

 If you have something else that I can try, I'd really appreciate it.