Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Custom Fields in the Cart or Checkout of Dawn theme

Custom Fields in the Cart or Checkout of Dawn theme

Adam_Bell
Shopify Partner
16 0 2

I'm trying to add a "How did you hear about us?" field in the cart. Pretty sure I can't do it at checkout unless I have Plus. I tried adding a HTML select menu to the main.cart.items.liquid section, but it just throws an error.

 

This is the code I'm using right after the closing table element:

 

          <label>How did you hear about us?</label><br>
  <select id="how-did-you-hear-about-us" name="attributes[How did you hear about us?]">
    <option value="Email"{% if cart.attributes["How did you hear about us?"] == "Email" %} selected{% endif %}>Email</option>
    <option value="Phone"{% if cart.attributes["How did you hear about us?"] == "Phone" %} selected{% endif %}>Phone</option>
    <option value="In Person"{% if cart.attributes["How did you hear about us?"] == "In Person" %} selected{% endif %}>In Person</option>
    <option value="From a Friend"{% if cart.attributes["How did you hear about us?"] == "From a Friend" %} selected{% endif %}>From a Friend</option>
  </select>

 

Reply 1 (1)

paramountariana
Visitor
1 0 0

I am having the same issue with the same theme. I used third party app SmartCA: Customer Attribute.

 

Hope that helps.