Update Cart Custom Fields

Carts (Orders) are Element Types and can have custom fields associated with them.

Custom fields can be useful for storing further information about an order that falls outside line item options or notes.

You are able to update the custom fields on a cart by posting data to the update-cart action.

<form method="post">
    <input type="hidden" name="action" value="commerce/cart/update-cart">
    {{ redirectInput('shop/cart') }}
    {{ csrfInput() }}

    <input type="text" name="fields[myFieldHandle]" value="">

    <input type="submit" value="Update cart">
</form>