michaeldank
9/11/2017 - 12:14 AM

Terms of Conditions Checkbox on Cart | This will put a checkbox that forces the users to tick so they can purchase items through the cart. U

Terms of Conditions Checkbox on Cart | This will put a checkbox that forces the users to tick so they can purchase items through the cart. Update the Terms of Conditions text and href link. Example: http://www.poct.net.au/products.html

<script>
  // ADD CHECK BOX TO CHECK OUT
  $('.checkoutSectionInner.checkoutPaypal').addClass('inactive');
  $('<div class="conditionsBox"><input type="checkbox" name="conditions" value="Conditions"><label for="Conditions"><a href="#">######## AGREE TO TERMS OF CONDITIONS ########</a></label></div>').insertBefore('.checkoutFinalPrice');


  $(function() {  
    $('input[value="Conditions"]').click(function(){
      $('.checkoutSectionInner.checkoutPaypal').toggleClass("inactive");
    });
  });
</script>
/*------SHOP TERMS OF CONDITIONS CHECKBOX-----*/

.checkoutSectionInner.checkoutPaypal.inactive {
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

.checkoutSectionInner.checkoutPaypal {
  opacity: 1;
  pointer-events: all;
}

.conditionsBox
{
  display: block;
  padding: 20px;
  box-sizing: border-box;
  margin: 0 auto;
  border: 1px solid rgba(0,0,0,.1);
  margin: 10px 0;
  font-size: .9em;
}

.conditionsBox input
{
  -webkit-appearance: checkbox;
  margin-right: 10px;
}