Hi Guys,
I have implemented custome JQuery script to enable buy button at the cart drawer (slider cart). If user accept the T&C by checking check box the buy button will be enabled. But this is not working, if add any item to the cart. if I refresh the page it is working, if I and any items in to the cart it won’t work again. can some one help.
Below are the code and implemnataiton. You can visit website here https://www.motorious.dk/ it was deployed to live. Motorious
-
Jquery I have used “jQuery v3.6.0” version
-
Below was the java scirpt I have used
$(document).ready(function(){
$('#checkout').prop('disabled', true);
$('#consentCheckbox').click(function () {
if ($(this).prop('checked')) {
$('#checkout').prop('disabled', false);
} else {
$('#checkout').prop('disabled', true);
}
});
});
hi @Kulwinder2 ,
if you want the user to obligatory click to button accept T&C before they can click into checkout button,
you need make for checkout button is disable default, then you going to check cases for checkbox.
Hope can helpful to you!
Hi @DitalTek thank for the reply,
I have tried that also, once it was disable at on load by putting inline style, we can’t enable back.
I have kept console logs in that function, it was not printing in the console, so that means this function is not at all called, eventhough function was loaded int the page. I have verified there is unique ids for the buttion and checkbox in that page.
Thanks .
@Kulwinder2 ,
If that, we need checkout in the file handing the code, because i don’t know which that code you how doing to you handle now currently.
Let me know what can I do for checkout.
sorry, i mean you need going to code file for check.
make sure you selector right the element tag, and handle right event for them.