One of the most common advanced feature requests we are getting these days is from store owners need to ask their customer for additional data prior to checkout.
Some people had some success with services like Wufoo but the end result lacks a nice integration.
A new feature which came online with the last deployment of Shopify is the ability to attach notes and texts to orders from the cart page.
I’ll describe the basic functionality here. The feature is intentionally very unrestrictive and therefore very powerful. For many liquid wizards out there this should be exactly what they were waiting for.
When you update the content of a cart or click the checkout button on a standard Shopify
/cartpage Shopify will look for two special parameters called simply
noteand
attributes
Free text note
Note is the primary one and the simplest to use.
Imagine you are running a gift shop and you want to ask your customers for a Gift message to be included in the package. Add following html/liquid code to your cart.liquid before the
</form>tag:
<p>
<label for="note">Gift note:</label><br/>
<textarea name="note" id="note" rows="3" cols="60">{{cart.note}}</textarea>
</p>

This order, after its placed and paid, will display the note in the Shopify admin

Attributes
Attributes let you attach any value to an order by choosing a name for it. They are very useful for creating more complex forms with checkboxes, drop-downs or even hidden fields which just attach the browser version or operating system of the client to the order.
You choose the name in the html name property using
attributes[name]style syntax like
<input type="checkbox" name="attributes[wrapping]" id="wrapping" value="yes" />
For our example, lets ask the customer if he wants his products gift wrapped:
<p>
<input type="checkbox" name="attributes[wrapping]" id="wrapping" value="yes" {% if cart.attributes.wrapping %} checked="checked"{% endif %} />
<label for="wrapping">Please wrap the products in this order</label>
</p>

You can add as many attributes as you like as long as you choose unique names ( between the brackets ).
Hope this will help make shopify more useful for shops which personalize their products.
This is really amazing! Thank you so much. I was one of the first to request this type of functionality on your forums and it is so cool to see the speed at which this was addressed.
Funny thing is I just spent a ton of time configuring some Wufoo forms to capture the additional information that is needed in my specialized business, but did not like the workflow at all. It required that the customer actually read the confirmation email and link to the “additional information” form. I know they just won’t do that.
Anyway, I am glad to go back and delay my live date just a little to include this new feature. I’m still glad that I found Wufoo since it too is an awesome tool and will be useful for other forms on my site (love to see a Wufoo/Shopify partnership).
Thanks again!
Thanks sooooooo much!!! This is exactly what I needed to really and truly make my week. I am going to play with this and get it working and then I am going straight to the pub and drink a pint on your behalf tobi :)
That shouldn’t make a difference but i just did a ninja deployment with a small bugfix which did cause Poof messages to appear. Maybe it reloaded the code right between your tries ? :)
Just in case tobi doesn’t have a chance to update the example before the weekend…. There’s a small typo in there that is throwing a poof
{{cart.note}}should be: (with spaces before and aft)
{{ cart.note }}That’s awesome Tobi!!!
One question – does any of this affect the RSS feed?
Are there any extra fields now?
Tobi You’re right…. I fiddled with it and for some reason I have been putting the spaces in my template files and when I changed your example to fit in my “spaced” view of things it scared it into working, but now it works both ways. We crossed timing on your ninja move while I was jumping in on this new piece of code.
Once again Thanks :)
We just use the note facility of the order which is part of the RSS feed.
We will check how commonly the feature is used and build more infrastructure on top of it in the future. This is just a 20% of the work, 80% of the payoff kind of solution for the meantime.
Thank you for the posting.
Could you provide a sample for a drop-down menu.
Thanks Tobi!
Do these extra fields turn up in the RSS feed for orders?
How do I allow a customer to elect to wrap only certain items in the cart and charge him appropriately? For example, $2 per item wrapped and he chose to wrap 3 out of 4 items for a total cost of $6; I also have to know which items he chose to have wrapped + message for each. Thank you.
Is there a way to limit customers to select only one attribute? For example, I added a few radio buttons to the cart page and cannot get shopify to limit to only one selection. Thanks!
Hi, I’m pretty much searching for what he is telling here
“winn October 24, 2011 09:29PM EDT
How do I allow a customer to elect to wrap only certain items in the cart and charge him appropriately? For example, $2 per item wrapped and he chose to wrap 3 out of 4 items for a total cost of $6; I also have to know which items he chose to have wrapped + message for each. Thank you."
Thanks