Show Featured Product Image in Cart rather than Variant Image

KotyPerry
Visitor
2 0 0

Hi, I'm wanting to show the default image for the product when adding to cart rather then a variant image. 

When adding to cart it looks like its storing an object called item that the site is storing product information. The object has a value called image that is storing the image value. I imagine its somewhere on the action of the form '/cart/add'?

My main question is, where is that 'item' object being created typically so that I can have it force the value of image to be the products featured_image? 

Replies 3 (3)

rajimulislamjoy
Shopify Partner
186 16 22

The "tem object you mentioned is typically created in the backend logic of the Shopify platform, specifically in the code handling the Add to Cart functionality. To force the value of the "image" property to be the product's featured image, you would need to customize the code responsible for constructing this "item" object. This customization might involve modifying Shopify's liquid templates or utilizing custom JavaScript to override the default behavior. It's recommended to consult with a Shopify developer or reach out to Shopify Support for guidance on implementing this customization effectively.

Please don't forget to Like & Mark Solution to the post that helped you. Thanks!
If you'd like to support me, you can Buy Me a Coffee
Need a Shopify Designer or Dropshipping Expert ?
Hire us at WhatsApp! For Shopify Design | Shopify Customize | Dropshipping
KotyPerry
Visitor
2 0 0

Got it, so the code that typically handles the add to cart functionality isn't in the theme itself? If it is, can you point me where it typically is or what it looks like?

rajimulislamjoy
Shopify Partner
186 16 22

The code for the "Add to Cart" functionality is typically within the theme files, specifically in the product template (product.liquid or similar)

Please don't forget to Like & Mark Solution to the post that helped you. Thanks!
If you'd like to support me, you can Buy Me a Coffee
Need a Shopify Designer or Dropshipping Expert ?
Hire us at WhatsApp! For Shopify Design | Shopify Customize | Dropshipping