Skip to main content

shopify:cart:note-update

Fires when a buyer sets or clears the cart note. The note is a single free-text field on the cart, used for gift messages and delivery instructions.

You can use this to keep your own copy of the note in sync, or to check what a buyer typed before checkout. The event fires before the note is saved, and the promise resolves with the updated cart.

You dispatch it from the element holding the note field, in the cart drawer or on the cart page.

An empty string clears the note. Because the event fires when the operation starts, it fires whether or not the change succeeds. If the cart declines the change, the promise resolves with the cart as it stands and userErrors explaining why. If the request fails, the promise rejects and shopify:cart:error is dispatched.

Anchor to context
context
'product' | 'cart' | 'dialog' | 'standard-action'
required

Where the update came from. The standard-action value is reserved for events that standard storefront actions emit automatically.

string
required

The new note text.

Anchor to promise
promise
Promise<>
required

Resolves with a CartNoteUpdateResult when the update finishes. It rejects if the request fails or is aborted.

Anchor to detail
detail
Record<string, unknown>

Optional custom data for the storefront's internal use. Listeners can read it.


Was this page helpful?