Sure.
// Fetch Query Strings
jQuery(document).ready(function($){
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, '\\$&');
let regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
//Store them in variables
let total = getParameterByName('total');
let email = getParameterByName('email');
let full_name = getParameterByName('full_name');
/*
Since I have different scenarios
and multiple forms (product shortcodes) on single page
I am showing different form based on total amount
and want the form to open automatically
*/
if (total == 165.00) {
setTimeout(function() {
$(".first-product-class").trigger('click');
$(".asp-popup-iframe").load (function(){
$('.asp-popup-iframe').contents().find('#email').attr('value', email);
$('.asp-popup-iframe').contents().find('#billing-name').attr('value', full_name);
});
},10);
}
else if...
});