Adding a check box to cart

Highlighted
New Member
1 0 0

Hi

So I have used code from here https://help.shopify.com/themes/customization/cart/add-terms-and-conditions-checkbox , which adds a check box for terms and conditions. However I wish to add the box to ask customers if they dont want their order to be delivered until Christmas. I have managed to add this in and also so the box doesnt need checked in order to proceed. However when I look at the orders once they are placed I can not tell if they have checked the box or not. Is there a way, in the notes for example, to say if the box was checked or not?

The code i currently have in the theme.liquid

<script>
$('body').on('click', '[name="checkout"], [name="goto_pp"], [name="goto_gc"]', function() {
  if ($('#agree').is(':checked')) {
    $(this).submit();
  }
});
</script>

The code I currently have in cart.liquid

<p style="float: none; text-align: left; clear: both; margin: 10px 0;">
  <input style="float:none; vertical-align: middle;" type="checkbox" id="agree" />
  <label style="display:inline; float:none" for="agree">
    Deliver just before Christmas?
  </label>
</p>  

 

Thank you

0 Likes
Highlighted
Shopify Staff
Shopify Staff
47 0 10

Hello Holly! Paul here, from the Guru team.

I would recommend using our "Gift wrap" method! You can of course change the wording so it is "Christmas delivery" instead of giftwrap, but the outcome is the same - an optional check box in the cart, the status of which is recorded in the order. Check it out!

https://help.shopify.com/themes/customization/cart/add-gift-wrap-option

I think this would work perfectly for your needs!

Cheers,

- Paul B

0 Likes
Highlighted
New Member
1 0 1

Hi Paul,

 

Does using this method still require a product to be created? I am just wanting the checkbox at the bottom of the cart to say "this is a gift."

 

Thank you!

1 Like
Highlighted
New Member
2 0 0

Hi Paul, 

 

Will this work in any theme? I am currently using Debut.

0 Likes