Customize Checkout - Collect extra product/order information

New Member
2 0 0


I want to somehow intercept the "Buy Now" button and store an additional piece of data in a hidden field in the order.

I assume there is some way, using JQuery, to prevent to default action of the "buy now" button to do this before it submits?

So, somehow I need to be able to

  1. Add a hidden field to the order form. Which will be available in the order webook/admin area.
  2. Intercept the action of the "Buy Now" button.

I am new to Shopify development so apologies for my lack of knowledge.

Any help would be greatly appreciated.

209 1 106

Look into cart[attributes] field.

Two ways you can get data in this field, which then gets stored on the cart / checkout / order object and shows up in the shopify admin


Here's an example of the field you need to populate in your add to cart form, or on your /cart page form. This data will get passed into order.

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


As for hooking into the "Buy Now" button, that's something you'll need to do with javascript by hooking into onsubmit.