Hi guys, I was trying to follow the below suggestion from a Gemini search result from google search, but the checkout.liquid doesn’t seem to exist, any ideas? Thanks!!
Gemini’s output:
To add a “how did you hear about us” field to your Shopify order page, you need to customize your theme code by adding a custom field within the checkout form, usually done by creating a liquid snippet and inserting it into the relevant section of your checkout template; this requires basic coding knowledge or the use of a Shopify app that allows for custom checkout fields.
Here’s a breakdown of the steps:
- Access your theme code:
- Go to your Shopify admin.
- Navigate to Online Store > Themes.
- Select the theme you want to edit and click “Actions” > “Edit code”.
- Create a liquid snippet:
- In the “Snippets” directory, click “Add a new snippet”.
- Name it something like “how-did-you-hear”.
- Paste the following code into the snippet, customizing the options in the dropdown as needed:
Code
<div class="form-field">
<label for="how-did-you-hear">How did you hear about us?</label>
<select name="how-did-you-hear" id="how-did-you-hear">
<option value="Social Media">Social Media</option>
<option value="Friend Recommendation">Friend Recommendation</option>
<option value="Search Engine">Search Engine</option>
<option value="Email Marketing">Email Marketing</option>
<option value="Other">Other</option>
</select>
</div>
- Add the snippet to your checkout template:
- Open the “checkout.liquid” file in the “Sections” directory.
- Find the section where you want to add the “how did you hear” field (usually near other customer information fields).
- Paste the following code to insert the snippet:
Code
{{ 'how-did-you-hear' | snippet }}
Important Considerations:
-
Theme compatibility:
Depending on your theme, the exact code structure and where to insert the snippet might differ. -
Required field:
To make the “how did you hear” field mandatory, add the “required” attribute to the