All things Shopify and commerce
I have written a code for customer to accept terms and condition on cart page before pressing checkout button. The functionality works great.
The only issue that i face here is there are some tech savy customers who click on terms and condition checkbox --> go to inspect element --> uncheck the checkbox --> presss checkout button and goes to checkout page without accepting terms and condition.
I dont want to disable inspect element for the same.
I want to make modification in my code where even if customer unticks the checkbox via inspect element, he should not be able to move to checkout page.
here is my code:
<div class="form-group terms-and-conditions cart-attribute__field">
<input type="hidden" name="attributes[terms-and-conditions]" value="No">
<input
required
class="required input--terms-and-conditions"
type="checkbox"
name="attributes[terms-and-conditions]"
value="I agree to the terms and conditions"{% if cart.attributes["terms-and-conditions"] == "I agree to the terms and conditions" %} checked{% endif %}>
<label>I've read and accept the <a href="pages/terms-and-conditions">terms and conditions.</a></label>
</div>
Solved! Go to the solution
This is an accepted solution.
I dont think it is possible to disable edit on inspect element, it is a web browser function.
Would it be better to add a text above the checkout button like "By clicking the checkout button, I accept the terms and condition" ?
This is an accepted solution.
I dont think it is possible to disable edit on inspect element, it is a web browser function.
Would it be better to add a text above the checkout button like "By clicking the checkout button, I accept the terms and condition" ?
Hi soulchild37,
keeping checkbox is mandatory. It is just that customer should not edit via inspect element. I am worried of how can I achieve this?
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024