Code advice for variations / text boxes

Topic summary

A user seeks to conditionally display a text box on their product page only when customers select a specific variation (“yes please” for adding a message inside a greeting card). They’re using Shopify’s Dawn theme with custom liquid code already in place.

Current Challenge:

  • The text box needs to appear/hide based on variant selection
  • Requires JavaScript and Liquid coding modifications to theme files

Proposed Solutions:

  1. Custom coding approach: Multiple respondents confirm this requires JS and Liquid development work in theme files, suggesting hiring a Shopify developer if unfamiliar with coding
  2. Alternative workaround: Create separate products using alternate templates for “with message” vs “without message” options, then use buttons/links to guide customers between the two products

Status: The original poster acknowledges being out of their depth with coding and will likely need external help. One developer offered to add collaborator access to implement the JS code solution.

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

Hello, I am hoping someone can help me, I am hoping it is possible to have a text box appear only if a customer selects a variation. This would be for a message inside a greetings card, if the customer selected ’ yes please’ on my variations I would like this box to be visible. But not if the select no thank you.

I am using the Dawn theme and the text box is coded into the design using the custom liquid feature on the website editor. The code currently being used is;

If you have selected to add a message inside the card it can be left here

https://www.pmprinted.co.uk/products/wife-i-have-really-enjoyed-annoying-you-20025

Hey @PMPrinted

This type of work is not only possible and requires JS and liquid coding in your theme files so if you’re not familiar with coding then I suggest you to hire a Shopify developer who can help you out with that. Feel free to let me know if you want me to help you out and I would be more than happy to help you out.

Best Regards,

Moeed

Thank you I thought that maybe the case. I am busy designing the website so will add to the list of things I am out of my depth on!

1 Like

Hi @PMPrinted ,

Can I send you a collaborator invite? it will help me to check and add JS code for this

Hi @PMPrinted this requires an advanced theme customiation.

An alternative is just make these separate products using alternate templates.

https://help.shopify.com/en/manual/online-store/themes/os20/theme-structure/templates#create-a-new-template

Then shift where in the user journey a customer makes that choice.

Such as adding links/buttons in both templates to send the customer between the two products.

Or a collection or page as the landing page ,etc

If you need this customization then contact me for services
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.