var wps_wpr = {"ajaxurl":"https:\/\/hobbylegends.com\/wp-admin\/admin-ajax.php","message":"Please enter a valid points","empty_notice":"Please enter some points !!","minimum_points":"50","confirmation_msg":"Do you really want to upgrade your user level as this process will deduct the required points from your account?","minimum_points_text":"The minimum Points Required To Convert Points To Coupons is 50","wps_wpr_custom_notice":"The number of points you had entered will get deducted from your Account","wps_wpr_nonce":"f1ae99340b","not_allowed":"Please enter some valid points!","not_suffient":"You do not have a sufficient amount of points","above_order_limit":"Entered points do not apply to this order.","points_empty":"Please enter points.","checkout_page":"","wps_user_current_points":"0","is_restrict_message_enable":"","is_restrict_status_set":"","wps_restrict_rewards_msg":"You will not get any Reward Points","wps_wpr_game_setting":[],"wps_wpr_select_spin_stop":[],"wps_is_user_login":"","get_min_redeem_req":"0","is_cart_redeem_sett_enable":"0","is_checkout_redeem_enable":"0","points_coupon_name":"Cart Discount","wps_points_name":"Points","points_message_require":"You require : ","points_more_to_redeem":" points more to get redeem","wps_add_a_points":"Add a points","wps_apply_points":"Apply Points"};
var srpscripts_params = {"ajaxurl":"https:\/\/hobbylegends.com\/wp-admin\/admin-ajax.php","enable_option_nonce":"cbeba8f8ba","checked_alert_msg":"Are you sure you want to be part of the Reward Points Program?","unchecked_alert_msg":"Are you sure you want to exit the Reward Points Program?"};
var wc_add_to_cart_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","wc_ajax_url":"\/?wc-ajax=%%endpoint%%","i18n_view_cart":"View cart","cart_url":"https:\/\/hobbylegends.com\/cart\/","is_cart":"","cart_redirect_after_add":"no"};
var fp_cashback_action_params = {"ajaxurl":"https:\/\/hobbylegends.com\/wp-admin\/admin-ajax.php","fp_cashback_request":"4737c9b1a7","fp_cancel_request":"97a6ac68a5","available_points":"0","minpointstoreq":"1","maxpointstoreq":"5000","paymentmethod":"2","conversionrate":"1","conversionvalue":"1","redirection_type":"1","redirection_url":"","enable_recaptcha":"no","user_role_percentage":"100","cash_back_reason":"no"};
var frontendscripts_params = {"ajaxurl":"https:\/\/hobbylegends.com\/wp-admin\/admin-ajax.php","generate_referral":"25c1d1070e","unset_referral":"7b0edf9572","unset_product":"bbdeb40521","booking_msg":"4273c8f941","variation_msg":"bc3ef807f5","enable_option_nonce":"cbeba8f8ba","loggedinuser":"no","buttonlanguage":"1","wplanguage":"","fbappid":"","url":"https:\/\/hobbylegends.com\/sample-page\/","showreferralmsg":"1","showearnmsg":"1","showearnmsg_guest":"1","showpurchasemsg":"1","showbuyingmsg":"1","productpurchasecheckbox":"yes","buyingpointscheckbox":"no","buyingmsg":"1","variable_product_earnmessage":"no","enqueue_footable":"1","check_purchase_notice_for_variation":"yes","check_referral_notice_for_variation":"no","check_buying_notice_for_variation":"no","is_product_page":"","is_date_filter_enabled":"2","custom_date_error_message":"From Date and To Date is mandatory","default_selection_error_message":"Please select any option"};
This is an example page. It’s different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:
Hi there! I’m a bike messenger by day, aspiring actor by night, and this is my website. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin’ caught in the rain.)
…or something like this:
The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.
As a new WordPress user, you should go to your dashboard to delete this page and create new pages for your content. Have fun!
function paypaltogglePopup() {
jQuery(".paypalemailid").toggle();
}
function validatePhone(txtPhone) {
var phonenumber = txtPhone;
var filter = /^((\+[1-9]{1,4}[ \-]*)|(\([0-9]{2,3}\)[ \-]*)|([0-9]{2,4})[ \-]*)*?[0-9]{3,4}?[ \-]*[0-9]{3,4}?$/;
if (filter.test(phonenumber)) {
return true;
} else {
return false;
}
}
//validating address field on register page so that user cant enter random data
function validateAddress(addressInput, e) {
if( typeof placeId === 'undefined' || placeId === null || !placeId) {
// User hasn't selected an address from the suggestions
console.log('Please select an address from the suggestions.');
var html = '<ul class="woocommerce-error"><li><strong>Error:</strong> Please select a valid address from the autocomplete suggestions.</li></ul>';
jQuery(html).insertBefore("form.woocommerce-form-register");
e.preventDefault(); // Prevent form submission if the address is empty
jQuery('html, body').animate({
scrollTop: jQuery('.woocommerce-error').offset().top- 300
}, 1000);
return false;
}else{
// User has selected an address from the suggestions
// Proceed with your further validation or processing
console.log('Address is validated. Place ID: ' + placeId);
// var user_address = addressInput.val();
if (user_address === '') {
var html = '<ul class="woocommerce-error"><li><strong>Error:</strong> Please select a valid address from the autocomplete suggestions.</li></ul>';
jQuery(html).insertBefore("form.woocommerce-form-register");
e.preventDefault(); // Prevent form submission if the address is empty
jQuery('html, body').animate({
scrollTop: jQuery('.woocommerce-error').offset().top- 300
}, 1000);
return false;
} else {
// Make a synchronous API request to the Google Geocoding API
var apiKey = 'AIzaSyB0mAr0TtwwE4kSoCh42pquepIYhDw3VBs'; // Replace with your Google API key
var geocodingApiUrl = 'https://maps.googleapis.com/maps/api/geocode/json';
// Prepare the parameters for the API request
var requestData = {
address: user_address,
key: apiKey
};
var isValid = false;
// Send the API request
$.ajax({
url: geocodingApiUrl,
data: requestData,
async: false, // Make the request synchronous
success: function (response) {
if (response.status === 'OK') {
// Address is valid
isValid = true;
var location = response.results[0].geometry.location;
var latitude = location.lat;
var longitude = location.lng;
console.log('Latitude: ' + latitude);
console.log('Longitude: ' + longitude);
e.preventDefault();
} else {
// Address is not valid, display an error message
var errorMessage = 'Invalid or incomplete address. Please select a valid address.';
var html = '<ul class="woocommerce-error"><li><strong>Error:</strong> ' + errorMessage + '</li></ul>';
jQuery(html).insertBefore("form.woocommerce-form-register");
e.preventDefault();
// Scroll to the error message
jQuery('html, body').animate({
scrollTop: jQuery('.woocommerce-error').offset().top- 300
}, 1000); // You can adjust the scrolling duration (1000ms = 1 second)
}
}
});
return isValid;
}
}
}
jQuery(document).ready(function() {
//jQuery('form.woocommerce-EditAccountForm fieldset').remove();
jQuery('form.woocommerce-form-register').on('submit', function(e) {
var reg_username = jQuery('form.woocommerce-form-register input#reg_username').val();
var reg_email = jQuery('form.woocommerce-form-register input#reg_email').val();
var reg_password = jQuery('form.woocommerce-form-register input#reg_password').val();
var phonenumber = jQuery('form.woocommerce-form-register input#phone_number').val();
//var user_address = jQuery('form.woocommerce-form-register textarea#user_address').val();
var addressInput = jQuery('form.woocommerce-form-register textarea#user_address');
jQuery('.woocommerce-error').remove();
if (reg_username == '') {
var html = '<ul class="woocommerce-error"><li><strong>Error:</strong> Please provide a username.</li></ul>';
jQuery(html).insertBefore("form.woocommerce-form-register");
e.preventDefault();
} else if (reg_email == '') {
var html = '<ul class="woocommerce-error"><li><strong>Error:</strong> Please provide a valid email address.</li></ul>';
jQuery(html).insertBefore("form.woocommerce-form-register");
e.preventDefault();
} else if (phonenumber != '' || phonenumber == '') {
if (phonenumber == '') {
var html = '<ul class="woocommerce-error"><li><strong>Error:</strong> Please provide a phone number.</li></ul>';
jQuery(html).insertBefore("form.woocommerce-form-register");
e.preventDefault();
} else {
if (!validatePhone(phonenumber)) {
var html = '<ul class="woocommerce-error"><li><strong>Error:</strong> Please provide a valid phone number.</li></ul>';
jQuery(html).insertBefore("form.woocommerce-form-register");
e.preventDefault();
} else {
// if (user_address == '' ) {
// var html = '<ul class="woocommerce-error"><li><strong>Error:</strong> Please provide address.</li></ul>';
// jQuery(html).insertBefore("form.woocommerce-form-register");
// e.preventDefault();
// }
if (!validateAddress(addressInput, e)) {
e.preventDefault(); // Prevent form submission if the address is not valid
}
}
}
} else if (user_address == '') {
var html = '<ul class="woocommerce-error"><li><strong>Error:</strong> Please provide address.</li></ul>';
jQuery(html).insertBefore("form.woocommerce-form-register");
e.preventDefault();
} else {
}
})
jQuery('.paymentGateway button').click(function() {
jQuery('body').addClass('popup-body');
});
jQuery('.paypalemailid .close-btn').click(function() {
jQuery('body').removeClass('popup-body');
});
jQuery('#paypalemailbutton').click(function() {
var paypalemail = jQuery('#paypalemail').val();
if (paypalemail) {
jQuery('.loadingImg').show();
var ajax_url = "https://hobbylegends.com/wp-admin/admin-ajax.php";
var datas = {
'action': 'verificationPaypalEmail',
'paypalemail': paypalemail
};
jQuery.ajax({
url: ajax_url,
type: 'POST',
data: datas,
success: function(response) {
jQuery('.loadingImg').hide();
jQuery('#requestresponse').html(response);
setTimeout(function() {
location.reload();
}, 1500);
}
});
} else {
jQuery('#paypalemail').css('border', '1px solid red');
}
})
});
var video = document.getElementById('banner-vdo');
function toggleMutes() {
video.muted = !video.muted;
}
jQuery(document).ready(function($) {
//var video=document.getElementById("banner-vdo") ;
$(video).on("click", function(e) {
video.muted = !video.muted;
});
})
var wc_order_attribution = {"params":{"lifetime":1.0e-5,"session":30,"base64":false,"ajaxurl":"https:\/\/hobbylegends.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","utm_source_platform":"current.plt","utm_creative_format":"current.fmt","utm_marketing_tactic":"current.tct","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}};
//paste this code under the head tag or in a separate js file.
// Wait for window load
$(document).ready(function(){
// Animate loader off screen
$(".se-pre-con").fadeOut("slow");
});