News:

Support the VirtueMart project and become a member

Main Menu

Joomla 4 and jQuery 3 .attr("checked") method

Started by ssc3, November 14, 2021, 18:01:13 PM

Previous topic - Next topic

ssc3

In the checkout page

if($(this).attr("checked")){

is used in the checkout to determine if required elements such as "Terms and Conditions" are checked.
It helps to determine if the checkout task should be set to "confirm" and submit button to "Confirm Purchase"
In Joomla 4 jQuery 3.6 this value does not change when the check box is checked.
Instead it returns the original default status of the checkbox.
Suggest replacing with

if($(this).prop("checked")){

in view.html.php

to determine the current state of the checkbox. This also backwards compatible with Joomla 3
Virtuemart Payment Plugins
https://plugins.online-store.co.uk

ssc3

Still a problem with VirtueMart 4.0.0 10645

To avoid the

"Checkout done, please confirm the order"

error message after ticking "Terms of Service" and checking out, replace in view.html.php

if($(this).attr("checked")){

by

if($(this).prop("checked")){

The former no longer works correctly Joomla 4 jQuery 3.6 when counting the number of required fields.

Virtuemart Payment Plugins
https://plugins.online-store.co.uk

Milbo

I am sorry, I did not see your post. Should work also in j3, I did a simple test, seem to works, thanks.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/