A user wants to add an email input field before the “Add to Cart” button, but only for products in a specific collection (Wix templates). The store uses an outdated Shopify Dawn theme.
Solution Provided:
Create a metafield named “Display input field” with type True/False
Add custom code to snippets -> buy-buttons.liquid that conditionally displays the input field based on the metafield value
Enable the metafield only for products that should show the input field
Implementation:
One helper (Guleria) provided step-by-step guidance and ultimately accessed the store via collaborator code to implement the solution
The solution was successfully tested on a sample product
Code uses Liquid templating to check if product.metafields.custom.display_input_field is true before rendering the input field
Status: Resolved. The user confirmed it “worked like butter.”
Follow-up Question: The user also asked about displaying collection titles instead of banner images when metafields are left blank, which would require additional customization.
Summarized with AI on November 3.
AI used: claude-sonnet-4-5-20250929.
i want to create input text filed before add to cart button on product page to get email of client before making purchase, i want it for specific collection’s products. not for all products.
any suggestion ?
below is my store link and pswd and i want for my wix templates collection
thank you for the response, can you please help me with more steps, i’m not sure which metafield i have to select since not showing any for the custom code.
also i wanted to ask something, i have created metafield to assign different banners collection vise. however in some collection i just want to keep titles. is there any suggestion ?