(function ($){
jQuery('.fooevents-copy-from-purchaser').on('click', function (){
var billing_first_name=jQuery('#billing_first_name').val();
var billing_last_name=jQuery('#billing_last_name').val();
var billing_email=jQuery('#billing_email').val();
var billing_phone=jQuery('#billing_phone').val();
var billing_company=jQuery('#billing_company').val();
var parent=jQuery(this).parent('p').parent('div');
parent.find('input').closest('.fooevents-attendee-first-name input').val(billing_first_name);
parent.find('input').closest('.fooevents-attendee-last-name input').val(billing_last_name);
parent.find('input').closest('.fooevents-attendee-email input').val(billing_email);
parent.find('input').closest('.fooevents-attendee-telephone input').val(billing_phone);
parent.find('input').closest('.fooevents-attendee-company input').val(billing_company);
return false;
});
if('autocopy'==frontObj.copyFromPurchaser||'autocopyhideemail'==frontObj.copyFromPurchaser){
var billing_first_name=jQuery('#billing_first_name').val();
var billing_last_name=jQuery('#billing_last_name').val();
var billing_email=jQuery('#billing_email').val();
var billing_phone=jQuery('#billing_phone').val();
var billing_company=jQuery('#billing_company').val();
jQuery('.fooevents-attendee-first-name input').val(billing_first_name);
jQuery('.fooevents-attendee-last-name input').val(billing_last_name);
jQuery('.fooevents-attendee-email input').val(billing_email);
jQuery('.fooevents-attendee-telephone input').val(billing_phone);
jQuery('.fooevents-attendee-company input').val(billing_company);
jQuery('.woocommerce-billing-fields input').not('.attendee-class input').on('change', function (){
var billing_first_name=jQuery('#billing_first_name').val();
var billing_last_name=jQuery('#billing_last_name').val();
var billing_email=jQuery('#billing_email').val();
var billing_phone=jQuery('#billing_phone').val();
var billing_company=jQuery('#billing_company').val();
jQuery('.fooevents-attendee-first-name input').val(billing_first_name);
jQuery('.fooevents-attendee-last-name input').val(billing_last_name);
jQuery('.fooevents-attendee-email input').val(billing_email);
jQuery('.fooevents-attendee-telephone input').val(billing_phone);
jQuery('.fooevents-attendee-company input').val(billing_company);
});
}})(jQuery);
(function ($){
jQuery(document).on('click', '.fooevents-variation-row__details label', function (event){
var inputID=jQuery(this).attr('for');
var quantityInputElement=inputID ? document.getElementById(inputID):null;
if(! quantityInputElement){
return;
}
var quantityInput=jQuery(quantityInputElement);
var maxValue=parseFloat(quantityInput.attr('max'));
if(quantityInput.prop('readonly')||quantityInput.prop('disabled')||(! isNaN(maxValue)&&maxValue <=0)){
return;
}
event.preventDefault();
var stepValue=parseFloat(quantityInput.attr('step'));
var currentValue=parseFloat(quantityInput.val());
if(isNaN(stepValue)||stepValue <=0){
stepValue=1;
}
if(isNaN(currentValue)||currentValue < 0){
currentValue=0;
}
var newValue=currentValue + stepValue;
if(! isNaN(maxValue)&&maxValue > 0&&newValue > maxValue){
newValue=maxValue;
}
quantityInput
.val(newValue)
.trigger('input')
.trigger('change')
.focus();
});
})(jQuery);