What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Retrieving checkout / cart buttons

Retrieving checkout / cart buttons

Chris_Hantis
Shopify Partner
54 3 6
Wondering if there is a way to easily retrieve the element attributes of a themes checkout button that are on the ‘your-domain.com/cart’ page and in the Ajax cart (side cart)?
CH
Reply 1 (1)

Jordan_L
Trailblazer
218 1 110

 

 

<input id="attr-myattribute" type="hidden" name="attributes[myattribute]" value="my attribute value" />

You can look at cart attributes and store values in there, which will get passed to cart/checkout/order objects and they're also shown on order page in the admin and you can edit them.

More info here
https://shopify.dev/docs/themes/liquid/reference/objects/cart