Add Survey to site

Liz_Maute
Shopify Partner
4 0 0

I want to know if I can put a short survey with a basic question like 'how did you hear of us' with a dropdown or checkbox radio.

What's the easiest way to do this? Would it make sense just to use an attribute option on the product page, or have a survey during checkout?

0 Likes
standoutd
Navigator
1135 0 128

Hi Liz. At this time, you can't mod Checkout in this way. We ask the question in the cart. The drop list is populated by a metafield where we delineate with a comma. You could hardcode them though or add a theme setting to do the same thing. Hopefully this can get you started (I really can't help debug though):

         <label class="span4" for="referrer_dropdown">How did you hear about us?</label>
                <select class="span4" name="attributes[referrer_dropdown]" id="referrer_dropdown">
                  <option value="Choose One">Choose one...</option>
                  {% assign options = shop.metafields.cart.referrers | split: ','%}
                  {% for option in options %}
                    <option value="{{ option }}"{% if cart.attributes.referrer_dropdown == option %} selected="selected"{% endif %}>{{ option }}</option>
                  {% endfor %}
                </select>
                <input class="span4" type="text" id="referrer_text" name="attributes[referrer_text]" placeholder="e.g. AVS Forum, Google, MSNBC" value="{{ cart.attributes.referrer_text }}" />
                

http://www.StandoutDesigns.com ::: Solid Wood TV Furniture for Enthusiasts. Made in USA.
0 Likes
Liz_Maute
Shopify Partner
4 0 0

Thanks! What file would I begin adding this code to? 

I tried adding a variant to the product that I wanted this info for, but I all ready have too many I think. Here's the product page I'd ideally like to add it to: http://www.store.niagarawinetrail.org/products/be-mine-with-wine

Suggestions are welcome!

0 Likes
standoutd
Navigator
1135 0 128

That code would go in cart.render. If you want to do on a per-product basis, as needed, you could tag those products and include an IF-THEN in product.liquid to show choices and save as line-item-property. We do that for glass. We assign a T/F based on if the tag is present (that var is in the first line below):

    {% if OfferGlassChoice %}
                                <div class="control-group">
                                    <label for="select-glass" class="control-label">Glass</label>
                                    <div class="controls">
                                        <select id="select-glass" name="properties[glass]" type="text" class="input-medium">
                                            <option>Clear</option>
                                            <option>Gray Tinted</option>
                                        </select>
                                    </div>
                                </div>
                            {% endif %}

http://www.StandoutDesigns.com ::: Solid Wood TV Furniture for Enthusiasts. Made in USA.
0 Likes
Liz_Maute
Shopify Partner
4 0 0

Thanks! This really helped a lot. I also found some useful info here: http://docs.shopify.com/manual/configuration/store-customization/ask-customer-for-more-information

I'm still working on formatting it, but it is working. I think I might just leave it for each order since most of the orders we will have I'll want this info :)

0 Likes
standoutd
Navigator
1135 0 128

Great. You are welcome. Good luck.

 

http://www.StandoutDesigns.com ::: Solid Wood TV Furniture for Enthusiasts. Made in USA.
0 Likes