To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more

Change Image of Product on Cart Page - Dawn Theme

JonCarag
Excursionist
21 1 4

Hello.  

 

I'm trying to figure out how to change the representative image of a product on the Cart page.  I know by default this image is set to the first image uploaded for the product.  However, for my situation, my first image is great to display by default on the product page but I want the Cart's image to be different and a little simpler.  How am I able to do this?  I have a Dawn 2.0 theme.

 

Thanks!

Replies 2 (2)
KetanKumar
Shopify Partner
36263 3609 11693

@JonCarag 

no sorry its not possible 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
PaulNewton
Shopify Partner
4876 408 1048

If you need this customization you can contact me(please provide context).

 

UX: warning don't casually swap images at different phases of what's shown to be put in the cart between product ,cart , and checkout pages it's a good way to confuse customers . Make sure you a/b test stuff like this if the variant-image a customer sees when they click add-to-cart will be swapped for another at a later time, especially if that image is no where on the product page.

 

Depending on theme this should just be solved by giving each variant it's own image.

https://shopify.dev/api/liquid/objects#line_item-image 

 

This can of course be a problem if you only have products that don't have multiple variants.

 

If you cannot have multiple variants on a product then you actually need to invert the situation to avoid other problems* and instead on product pages make some other image swap into the place of the featured image,

 

If you must do swap the image in the cart then  themes /cart template you would need to iterate through the line-items and access each line-items product object to get to other images, or some other construct depending on where this other image lives.

See dawn reference of example cart code  https://github.com/Shopify/dawn/blob/main/sections/main-cart-items.liquid#L69 

 

*But this can be a moot point for as soon as a visitor goes to /checkout the images shown will default to the default image. Unless you are on shopify Plus you cannot modify the checkout.

And you would also have to update ALL notification templates to reference some other media. 

 

 

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com