Display main product image despite definition of color variant images

Topic summary

A user is trying to display a main product image first, but the image for the preselected “black” color variant appears instead. Each color variant has its own linked image, which overrides the main product image.

Attempted Solution:
The user is following LaunchTip instructions to disable automatic variant selection by modifying the “Add to Cart” form (action attribute: /cart/add). However, they’re stuck because:

  • They cannot locate the product.liquid file in the Templates folder
  • Only JSON files appear in their theme (likely using Refresh theme)
  • Another user suggested the form is typically in product.liquid with attributes like action="/cart/add" and method="post"

Current Status:
The discussion remains unresolved. The user has requested additional help multiple times, and one respondent shared a YouTube link (potentially a tutorial), but the core issue of locating the correct file to edit persists.

Note: Some text in the original posts appears reversed/encoded, suggesting possible formatting issues.

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

Hello dear community,

I currently have a small problem with the “main product image” and the images for the individual product colors (/variants). I have linked a corresponding product image to each color variant.

Now, however, this is at odds with my “main product image”, which I want to be displayed first. Instead, the product image of the color variant “black” (since "product variant “black” is preselected) is displayed.

To solve the problem and so that my “main product image” is displayed first, I would have to remove the product images linked to the color variants and set these images without a link.

I am now following these instructions:

https://www.launchtip.com/turn-automatic-selection-off-product-variants/

but I’m stuck on this step right now:

  • Next, find the file containing the form for ‘add to cart.’ The action attribute in this file will be /cart/add> - Once you locate the file, look for one of the following codes

can you tell me where I can find the mentioned form for “Add to cart” with the action attribute /cart/add?

(i use the refresh theme)

best regards!

Hello @milalu

The “Add to Cart” form is most likely in the product.liquid file.

  • Login to your Shopify admin panel.
  • Go to Online Store > Themes.
  • Find the theme you’re using (likely “Refresh”) and click on Actions > Edit code.
  • In the Theme Editor, navigate to the Templates folder.
  • Open the product.liquid file.
  • Look for code that resembles a form with the following attributes:
    • method=“post”
    • action=“/cart/add”

The code will likely look something like this:

<form action="/cart/add" method="post" id="product-form-{{ product.id }}">
  ... (other form elements) ...
</form>

While you’re editing the product.liquid file, you can optionally follow the instructions from the LaunchTip article you linked to disable automatic variant selection.

1 Like

Thank you very much for your answer.

unfortunately I’m only now getting around to answering you myself. please forgive me.

unfortunately I don’t have a liquid file in the “Tamplate” folder. There are only .json files here. Which brings me back to the original problem: I can’t find the file in which I can make the entry.

do you have an answer for me?

Can someone else perhaps help me here?

best regards!

You can display selected color images: