Validation of the terms and conditions (custom module)
So, after being absent for a while I've found what causes the agreements to not be validated.
There is this file called agreements-assigner.js
, located in
Module_CheckoutAgreements/view/frontend/web/js/model
In this file, there is a variable called agreementForm
. This variable is assigned to the checkbox of the terms and agreements. Originally like this:
agreementForm = $('.payment-method._active div[data-role=checkout-agreements] input');
But of course, I moved the checkbox out of it's original location, so this path to the checkbox does not exist anymore.
If you, for example, change the variable as follows:
agreementForm = $('div[data-role=checkout-agreements] input');
The .js-file is able to locate your checkout agreements checkbox! Now your order can be placed succesfully.
A rather simple fix. I was trying to fix it using custom .js and stuff, and totally oversaw this file... ;)
NOTE: do not edit the core file directly. Rather copy it to your module or theme and alter the file according to your needs.