I need to show my product pic in landing page and not variant

AiRockers thank you for your response but i cant find this in my code: assign selected_variant_media = selected_product.featured_media

@spingar Sorry for missing your response.

You can add this condition to the file at the place highlighted in the screenshot.

Do let me know if you have any other questions.

Thanks!

Hi @AiRockers,

Thank you for your response and the code sample.

Unfortunately, it still doesn’t seem to be working. I added the code in the location you indicated, but the product page is still showing the variant image as the default image instead of the non-variant featured image.

I’ve attached a screenshot of my implementation. Am I perhaps placing the code incorrectly, or is there another part of the theme that also needs to be modified?

Thank you again for your help. I look forward to your guidance.

Best regards,

To fix this so your main featured image stays visible until a customer actively clicks a different option, you can adjust a small setting inside your theme.

  • Go to Online Store > Themes > Customize to open your editor.
  • Navigate to your Default Product page template from the top dropdown menu.
  • Click on the Variant Picker block in the left sidebar settings.
  • Look for a setting that says Select first variant by default and uncheck it (or change the default selection to None). Click Save.

Hi @spingar ,

Can you please share the complete code of “product-media-gallery-content.liquid”. I can test on my end and let you know.

Thanks!

Hi @AiRockers, i cant send the whole code here is there other way to send it to you?

@emilyjhonsan98 Thanks for your reply. That’s actually the whole issue: the Tinker Theme doesn’t have this option available.

There is no setting to disable the default variant selection or set it to “None”. As a result, a variant is automatically selected and the main product image changes immediately, whereas we want the featured image to remain visible until the customer actively selects a variant.

If anyone knows a solution specifically for the Tinker Theme, I would greatly appreciate your help.

@spingar Can you send a message with the complete code of the file - “product-media-gallery-content.liquid” ?

@Airockers, I can’t send the entire document/file in one message here, so I tried splitting the code into two messages. However, I get the following error:

“An error occurred: Sorry, new users can only mention 2 users in a post.”

Because of this restriction, I’m unable to post the full code, even when I split it into multiple messages.

Would you be able to access it through this link instead?

https://lmlg6y.staticfast.com

Please let me know if the link works for you or if you would prefer another way for me to share the file.

@spingar Thank you for sharing the code.

I replace the first file - snippets\product-media-gallery-content.liquid to my theme.

I am able to file the code snippet-
assign selected_variant_media = selected_product.featured_media

I replaced it with-

if selected_product.selected_variant

assign selected_variant_media = selected_product.selected_variant.featured_media

else

assign non_variant_image_srcs = selected_product.images | where: ‘attached_to_variant?’, false | map: ‘src’

assign selected_variant_media = null

for media in selected_product.media

if non_variant_image_srcs contains media.src

  assign selected_variant_media = media

  break

endif

endfor

if selected_variant_media == null

assign selected_variant_media = selected_product.featured_media

endif

endi

When the product page loads, I see the featured image, and when I select a product variant, only the variant product image appears.

Below are the screenshot from my test store.

@Airockers Then I must be doing something wrong, because it doesn’t work for me. Please see the screenshots attached.

I’ll share the screenshots across multiple posts, as I’m a new user and can only attach one screenshot per post.