VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: ssc3 on November 14, 2021, 18:01:13 PM

Title: Joomla 4 and jQuery 3 .attr("checked") method
Post by: ssc3 on November 14, 2021, 18:01:13 PM
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
Title: Re: Joomla 4 and jQuery 3 .attr("checked") method
Post by: ssc3 on May 07, 2022, 13:38:30 PM
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.

Title: Re: Joomla 4 and jQuery 3 .attr("checked") method
Post by: Milbo on May 07, 2022, 23:29:45 PM
I am sorry, I did not see your post. Should work also in j3, I did a simple test, seem to works, thanks.