I have managed to configure in cart-drawer.liquid the checkbox agree with the Terms and Conditions, but I want to make it requiered.
1º) The following code has been put in Assets / Theme.js:
$(document).ready(function() {
$('body').on('click', '[name="checkout"], [name="goto_pp"], [name="goto_gc"]', function() {
if ($('#agree').is(':checked')){
$(this).submit();
}
alert("You must agree with the terms and conditions of sales to check out.");
return false;
}
});
});
2º) In both cart-drawer.liquid and cart-template.liquid:
Hello Mariana, I’ve been looking for a solution for two weeks but I can’t find anywhere how to solve it. My company has hired a company certified by shopify, which charges us € 65 to do so. What do you think if we divide the expense between the two and ask them to do it in your store as well, since it is the same problem.
It would be € 32.5.
Hey @mc9745 , no need for apps! Check out this brief video tutorial on how to seamlessly add a ‘Agree to Terms and Conditions’ checkbox in your Shopify cart: https://www.youtube.com/watch?v=smyIqWWuZvs
@Jahid-KlinKode , I think I celebrated your solution too fast and you might want to double-check this.
After further testing, I found out that if you visit the Shopify store for the first time with a browser, the Check-out button doesn’t disable. You’ll need to refresh the page once or twice so that the Javascript code can actually apply on the targeted elements. This is not helpful since it means that every new customer connecting to our store will be able to access the checkout page without flagging the checkbox…