How to add custom attributes on shopify checkout?

Highlighted
New Member
2 0 0

Hi all,

I have a shopify plus account and I am trying to pass custom checkout attributes using the checkout.liquid file. I am trying to capture and pass a checkbox value as part of the order on checkout (below is the code) but it doesn't seem to pass it. Can someone please guide me on what am doing wrong and how to fix it?

<div class="checkbox-wrapper">
              <div class="checkbox__input">
                     <input type="hidden" value="No" name="checkout[attributes][packaging]">
                     <input class="input-checkbox" type="checkbox" name="checkout[attributes][packaging]" value="Yes">
              </div>
              <label>I want to opt for sustainable packaging.</label>
</div>
0 Likes
Highlighted
Shopify Partner
2 0 0

I'm facing same issue

I posted the code inside checkout.liquid and we are shopify plus but no luck

can anyone help on this please ?

what should we do to add attributes values on checkout ?

0 Likes
Highlighted
New Member
2 0 0

I figured out the issue after reaching out the the shopify plus support team. 

You will need to place the checkout attribute within the form tag on checkout.liquid and it will start getting captured.

0 Likes