Need help inserting upload button for certain variant

Topic summary

Goal: show a file upload button only when a specific product variant is selected, so customers can attach photos for a custom-painted product.

What was proposed:

  • Add a file input to main-product.liquid inside the product form. This makes uploads part of the line item properties (data stored with the cart item on checkout). One note: remove the Content-Type header since no JSON body is sent.
  • This approach applies sitewide and shows the upload for all products/variants. The image is attached to the selected variant via line item properties, but visibility is not limited to a specific variant by default.

Key clarifications:

  • To display the upload only for certain variants, custom code is required (e.g., conditional logic tied to variant selection). “Variant” = a specific option combination of a product; main-product.liquid = the product page template; line item properties = custom fields saved with the cart item.

Alternative solution:

  • Use a product options app with conditional logic (example suggested: Easify Product Options) to show a File Upload only for chosen variants. Screenshots of storefront and settings were provided.

Status: No public code solution posted for variant-specific visibility. Options are custom code or using an app; conversation remains open.

Summarized with AI on December 31. AI used: gpt-5.

Hi Luffy. How do I choose which variant it will be applied to?

Best regards
Log