Add a "Terms and conditions" checkbox

Adding a "terms and conditions" checkbox to your cart page Split theme:

  1. From your Shopify admin, go to Online Store > Themes.click Actions > Edit code.
  2. In the Assets directory, click js_main.js file (or js_main.min.js file if you are using an older theme version).
  3. At the bottom of the file, paste the following code: 
  4.  $(document).ready(function() {
        $('#section-cart').on('click', '[name="checkout"]', function() {
          if ($('#section-cart #agree').is(':checked')) {
            $(this).submit();
          }
          else {
            alert("You must agree with the terms and conditions of sales to check out.");
            return false;
          }
        }); 
      $('#site-cart').on('click', '[name="checkout"]', function() {
          if ($('#site-cart #agree').is(':checked')) {
            $(this).submit();
          }
          else {
            alert("You must agree with the terms and conditions of sales to check out.");
            return false;
          }
        });
      });
    	
  5. Click Save.
  6. In the Snippets directory, click cart-form.liquid find the HTML code for your cart total:
  7. <p class="total" id="CartTotal">{{ 'cart.total' | t }} <span>{{ cart.total_price | money }}</span></p>
        <small>{{ 'cart.shipping_at_checkout' | t }}</small>
    	

    On a new line below the cart total, paste the following code:

    <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">
        I agree with the <a href="/pages/terms-and-conditions">terms and conditions</a>.
      </label>
    </p>
    	
  8. Within the code you just pasted, replace /pages/terms-and-conditions with the URL of your terms and conditions page.
    Note: You will need to  create a terms and conditions page if it doesn't already exist.
  9. Click Save.