Change Image of Product on Cart Page - Dawn Theme

Topic summary

A user seeks to display a different product image on the cart page than the default first image shown on the product page in Dawn 2.0 theme.

Initial Responses:

  • One contributor states it’s not possible
  • Another offers custom development services

Technical Solution Provided:

  • The default cart image comes from line_item.image in Shopify’s Liquid API
  • For products with variants: assign each variant its own image to control cart display
  • For single-variant products: swap the featured image on the product page instead, rather than modifying cart images
  • Modifying cart images requires iterating through line items in the cart template to access alternative product images

Important Warnings:

  • Swapping images between product, cart, and checkout pages can confuse customers—A/B testing recommended
  • Checkout page images cannot be modified without Shopify Plus
  • Email notification templates would also need updating to maintain consistency

Implementation Note:
For Dawn theme specifically, modifications should target cart-drawer.liquid rather than main-cart-items.liquid.

One user inquires about dynamically swapping featured images based on real-time product customization parameters without affecting other visitors’ views.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

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!

2 Likes

@JonCarag

no sorry its not possible

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.

1 Like

“… and instead on product pages make some other image swap into the place of the featured image.”

Can you comment on which API/calls you had in mind for that?
Thank you.

(Why? Well, I’d like to do that swap on the fly each time a user changes some product customization parameter in the browser. And, naturally, that custom featured image should not affect other visitors’ view of the same product page.)

Hi PaulNewton,
I want similar feature to be implemented at my store, when I add the product to cart or Buy, I want to update the image of selected variant with the first variant’s image, irrespective of which variant is selected. Is this possible? If so please guide me how to do it.

PREVIEW

This is very helpful and close to the solution – but for Dawn you need to modify cart-drawer.liquid and not main-cart-items.liquid

1 Like

@nicholasm1

Please share your store URL so I can take a look and provide the right solution. If there’s anything specific you need help with, feel free to mention it!