Show Featured Image, Not Image of First Variant when the page is loaded

Boram7261
Visitor
3 0 0

Hi, I'm using the 'Impulse' theme. I would like to show the featured image (first image) rather than the image of the first variant when the page is initially loaded. So when the user clicks on the item to get to the product page, main product image to stay until the user selects a variant. Please help. 

Replies 10 (10)

PaulNewton
Shopify Partner
6274 573 1319

Impulse is made by archetypethemes , and is a premium theme meaning most contributors don't have access to it's code like they would with a free theme.

 

Contact archetypethemes to see if they support this customization here https://archetypethemes.co/pages/support

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


Boram7261
Visitor
3 0 0

Thank you. 

Have a good day:)

ksh_verma
Shopify Expert
35 2 4

Hi  Boram,

You need to change code in liquid file, find liquid file where product information render (mostly used product-template.liquid).
replace the code with:

{% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %}
Try changing it to:
{% assign featured_image = product.featured_image %}

Boram7261
Visitor
3 0 0

Thank you so much.

ksh_verma
Shopify Expert
35 2 4

Always welcome 🙂

mwebb33
New Member
4 0 0

This worked! Thank you!

TYH-AMI
Visitor
2 0 0

Any chance you can point out the liquid file you modified with this code?  Thank you

ranturgi93
Visitor
2 0 0

Hey, i have tried to find that code on the impulse 7.1 version and i didnt find it. can you help please?

ranturgi93
Visitor
2 0 0

@ksh_verma Hey! this is the code on Impluse 7.1 

i cant find the code u suggested to change. can you please assist? 

{%- liquid
assign current_variant = product.selected_or_first_available_variant

unless thumbnail_position
assign thumbnail_position = 'beside'
endunless

assign product_zoom_size = '1800x1800'
assign product_image_size = '620x'

case image_container_width
when 'small'
assign product_image_width = 'medium-up--two-fifths'
assign product_description_width = 'medium-up--three-fifths'
assign product_image_size = '480x'
when 'medium'
assign product_image_width = 'medium-up--one-half'
assign product_description_width = 'medium-up--one-half'
assign product_image_size = '620x'
when 'large'
assign product_image_width = 'medium-up--three-fifths'
assign product_description_width = 'medium-up--two-fifths'
assign product_image_size = '740x'
endcase

assign product_img_structure = product.featured_media | img_url: '1x1' | replace: '_1x1.', '_{width}x.'
-%}

aecom
Visitor
1 0 0

Hi there, found any solution for this?