Checkbox Placement on Cart Page

DenosTurnersLLC
New Member
2 0 0

I am trying to add a checkbox to appear above the sezzle option on my cart page. I would like it to say "I understand that if Route Insurance is not added to my cart, my order will be cancelled". I am not a pro with coding so I'm not sure where to even begin. 

https://denostumblerturnersllc.com/cart

This is my current code on the page

{% comment %}
The contents of the cart.liquid template can be found in /sections/cart-template.liquid
{% endcomment %}

{% section 'cart-template' %}
<script src=https://widget.sezzle.com/v1/javascript/price-widget?uuid=b27c11ba-3501-4507-bb04-b0064eb2335e></script>


{% section 'sezzle-widget' %}

Replies 3 (3)
Guleria
Shopify Partner
1810 382 546

Hello @DenosTurnersLLC ,

 

Just before of this code ( {% section 'sezzle-widget' %} )  add this one

<p class="cart-attribute__field">
  <input type="hidden" name="attributes[I understand that if Route Insurance is not added to my cart, my order will be cancelled]" value="No">
  <input type="checkbox" name="attributes[I understand that if Route Insurance is not added to my cart, my order will be cancelled]" value="Yes"{% if cart.attributes["I understand that if Route Insurance is not added to my cart, my order will be cancelled"] == "Yes" %} checked{% endif %}>
  <label>I understand that if Route Insurance is not added to my cart, my order will be cancelled</label>
</p>

 

Note: This code will add options as you want but to match it with your theme setup you have to write css accordingly.

 

Thanks

 

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
Buy me a coffee ☕ My PayPal
DenosTurnersLLC
New Member
2 0 0
It’s still below the payment options. Is there a way to move this above and also make it a mandatory checkbox they must check in order to proceed.
Guleria
Shopify Partner
1810 382 546

Yes there is way to add it there. If you want ti after subtotal then add the previously provided code after the scope of this code ( <div class="cart-subtotal"> )
If you want it before checkout button then add it before this html ( <div class="cart__submit-controls"> )
And to make it mandatory, actually html required attribute is already in field but it's not working here so you have to write custom JS to make it mandatory.

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
Buy me a coffee ☕ My PayPal