There are a couple of problems with what you're trying to do here.
The
discounts
variable is part of anorder
, and does not exist yet on the Cart page (discounts are added by the customer during the checkout process).cart.note
is created by having an input element withname="note"
inside the form on the Cart page, and the value of that element becomes the order'snote
. See here for more info.
Also, from the Shopify wiki about cart.note
:
Adds a note field to your checkout template... The general idea is that you simply define an input field named "note" in the form that submits to "/cart" in cart.liquid.
Where are you putting your code?
order.note
may be editable via the API, but I haven't tried this so I'm not sure.