apprentice

3) && (text.indexOf(.)

Switching between stores will remove products from your current cart.

; ); return meta_html; function checkRestrictedProduct(data) var utmSourceCustm = jQuery(utmSourceCustm).val(); var requestParams = type=p_r jQuery.each(data, function (key, value) requestParams += key + = + value + ); requestParams += ut_cs_src= + utmSourceCustm; var requestUrl = jQuery.ajax( type: GET, data: requestParams, url: requestUrl, dataType: JSON, success: function (data) var totalCount = parseInt(data); if (totalCount

This product is restricted in your country.

3)&&(text.indexOf(.)

; // jQuery(product-variations).remove(); // jQuery(product-share-links).remove(); jQuery(div.prime-text).remove(); // jQuery(product-view-full hr).remove(); // jQuery(.add-to-cart).html(); // jQuery(.availability).parent().remove(); // jQuery(product_avg_rating).remove(); // jQuery(review_form_container).remove(); // jQuery(customer-rating).remove(); jQuery(.single-product-description).html(showMessage); jQuery(remove_restriction_button).show(); else jQuery(remove_restriction_button).hide(); );

Take upto 15% OFF on your first purchase.

); return true; function fallbackCopyToClipboard(text) if (window.clipboardData && window.clipboardData.setData) // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. return clipboardData.setData(Text, text); else if (document.queryCommandSupported && document.queryCommandSupported(copy)) var textArea = document.createElement(textarea); // textarea.textContent = text; textArea.value = text; //textarea.style.position = fixed; // Prevent scrolling to bottom of page in Microsoft Edge. document.body.appendChild(textArea); textArea.focus(); textArea.select(); jQuery(ccode).select(); try return document.execCommand(copy); // Security exception may be thrown by some browsers. catch (ex) console.warn(Copy to clipboard failed., ex); return false; finally document.body.removeChild(textArea); function newcopyToClipboard(text) if (!navigator.clipboard) return fallbackCopyToClipboard(text); navigator.clipboard.writeText(text).then(function () return true; , function (err) return false; ); return true;

Copyright © 2021 Ubuy Co. All rights reserved.

57) && (event.which != 0 && event.which != 8))) event.preventDefault(); var text = jQuery(this).val(); if ((event.which == 46) && (text.indexOf(.) == -1)) setTimeout(function () if ($this.val().substring($this.val().indexOf(.)).length

3) $this.val($this.val().substring(0, $this.val().indexOf(.) + 3)); , 1); if ((text.indexOf(.) != -1) && (text.substring(text.indexOf(.)).length

2) && (event.which != 0 && event.which != 8) && (jQuery(this)[0].selectionStart

= text.length – 2)) event.preventDefault(); ); jQuery(fieldElm).bind(paste, function (e) var text = e.originalEvent.clipboardData.getData(Text); if (jQuery.isNumeric(text)) if ((text.substring(text.indexOf(.)).length

3) && (text.indexOf(.)

-1)) e.preventDefault(); jQuery(this).val(text.substring(0, text.indexOf(.) + 3)); else e.preventDefault(); ); if (jQuery(fieldElm).hasClass(validate-cpassword)) let msg = Please make sure your passwords match.; let equalto = .validate-password; if ]) validation_messages[fieldElm.name][equalTo] = msg; validation_rules[fieldElm.name][equalTo] = equalto; else validation_messages[fieldElm.name] = equalTo: msg; validation_rules[fieldElm.name] = equalTo: equalto; if (jQuery(fieldElm).hasClass(validate-currentpass)) let msg = The new password cannot be the same as the current password.; let notequalto = .currentpass; if (validation_rules[fieldElm.name]) validation_messages[fieldElm.name][notEqualTo] = msg; validation_rules[fieldElm.name][notEqualTo] = notequalto; else validation_messages[fieldElm.name] = notEqualTo: msg; validation_rules[fieldElm.name] = notEqualTo: notequalto; if (jQuery(fieldElm).hasClass(validate-password)) let minlengthval = 6; let maxlengthval = 30; let msg_min = Please enter 6 or more characters.; let msg_max = The Password must be a string with a maximum length of 30.; if (validation_rules[fieldElm.name]) validation_messages[fieldElm.name][maxlength] = msg_max; validation_rules[fieldElm.name][maxlength] = maxlengthval; validation_messages[fieldElm.name][minlength] = msg_min; validation_rules[fieldElm.name][minlength] = minlengthval; else validation_messages[fieldElm.name] = maxlength: msg_max; validation_rules[fieldElm.name] = maxlength: maxlengthval; validation_messages[fieldElm.name] = minlength: msg_min; validation_rules[fieldElm.name] = minlength: minlengthval; if (jQuery(fieldElm).hasClass(validate-alphanumeric)) if (validation_rules[fieldElm.name]) validation_rules[fieldElm.name][alphanumeric] = true; else validation_rules[fieldElm.name] = alphanumeric: true; if (jQuery(fieldElm).hasClass(validate-name)) if (validation_rules[fieldElm.name]) validation_rules[fieldElm.name][letterswithspace] = true; else validation_rules[fieldElm.name] = letterswithspace: true; if (jQuery(fieldElm).hasClass(validate-fullname)) if (validation_rules[fieldElm.name]) validation_rules[fieldElm.name][fullname_valid] = true; else validation_rules[fieldElm.name] = fullname_valid: true; validation_rules[fieldElm.name][notnumeric] = true; if (jQuery(fieldElm).hasClass(validate-notnumeric)) if (validation_rules[fieldElm.name]) validation_rules[fieldElm.name][notnumeric] = true; else validation_rules[fieldElm.name] = notnumeric: true; if (jQuery(fieldElm).hasClass(validate-availability)) let availabilitymsg = jQuery(fieldElm).data(checkmsg) fieldEmailAvailabilityMsg; if (validation_rules[fieldElm.name]) validation_messages[fieldElm.name][checkavailability] = availabilitymsg; validation_rules[fieldElm.name][checkavailability] = true; else validation_messages[fieldElm.name] = checkavailability: availabilitymsg; validation_rules[fieldElm.name] = checkavailability: true; if (jQuery(fieldElm).hasClass(validate-length)) var lengthType = ; if ((jQuery(fieldElm).attr(class)).search(minimum-length)) lengthType = minlength; if (validation_rules[fieldElm.name]) validation_messages[fieldElm.name][lengthType] = fieldLengthMsg; // validation_rules[fieldElm.name][lengthType] = true; else validation_messages[fieldElm.name] = minlength: fieldLengthMsg; // validation_rules[fieldElm.name] = lengthType: true; if ((jQuery(fieldElm).attr(class)).search(maximum-length)) lengthType = maxlength; if (validation_rules[fieldElm.name]) validation_messages[fieldElm.name][lengthType] = fieldLengthMsg; // validation_rules[fieldElm.name][lengthType] = true; else validation_messages[fieldElm.name] = maxlength: fieldLengthMsg; // validation_rules[fieldElm.name] = lengthType: true; if (jQuery(fieldElm).hasClass(validate-length1)) var lengthType = ; var lengthVal = ; var classesStr = jQuery(fieldElm).attr(class); var minstr = minimum-length; var minstrlen = minstr.length; var maxstr = maximum-length; var maxstrlen = maxstr.length; var minindexf = classesStr.search(minstr); var maxindexf = classesStr.search(maxstr); if (minindexf) lengthType = minlength; lengthVal = classesStr.slice(minindexf + minstrlen, minindexf + minstrlen + 1) if (validation_rules[fieldElm.name]) validation_messages[fieldElm.name][lengthType] = fieldLengthMsg; // validation_rules[fieldElm.name][lengthType] = true; else validation_messages[fieldElm.name] = minlength: fieldLengthMsg; // validation_rules[fieldElm.name] = lengthType: true; if (maxindexf) lengthType = maxlength; lengthVal = classesStr.slice(maxindexf + maxstrlen, maxindexf + maxstrlen + 1) if (validation_rules[fieldElm.name]) validation_messages[fieldElm.name][lengthType] = fieldLengthMsg; // validation_rules[fieldElm.name][lengthType] = true; else validation_messages[fieldElm.name] = maxlength: fieldLengthMsg; // validation_rules[fieldElm.name] = lengthType: true; ); jQuery(form_id).validate( errorClass: validation-advice, errorElement: div, highlight: function (element, errorClass, validClass) // jQuery(element).removeClass(validation-advice); , invalidHandler: function (form, validator) var errors = validator.numberOfInvalids(); if (errors) validator.errorList[0].element.focus(); , success: function (error, element) error.remove(); , errorPlacement: function (error, element) if(jQuery(.validation-advice.session-error).length) jQuery(.validation-advice.session-error).remove(); if (element.attr(type) == radio && element.parent(.radio-bubble)) error.appendTo(element.parent(.radio-bubble).parent()); else if (element.attr(type) == checkbox && element.parent(.input-checkbox)) error.appendTo(element.parent(.input-checkbox)); else if (element.parent(span).length) element.parent(span).after(error); else element.after(error); , rules: validation_rules, messages: validation_messages, submitHandler: function (form) if (is_submit) if(jQuery(form).valid()) showLoaderImage(); form.submit(); ); return; ubuy_alert = function (msg) let modal_id = ubuy-alert-modal; jQuery(body

div + modal_id).remove(); /*added confirm modal popup html*/ let html = `

`; jQuery(body).prepend(html); jQuery(modal_id).modal(show); ; ubuy_confirm = function (msg, cb) let modal_id = ubuy-confirm-modal; jQuery(body

div + modal_id).remove(); jQuery(body confirm-modal-open-css).remove(); /*added css to prevent to top scroll of window*/ let htmlcss = “; jQuery(body).append(htmlcss); /*added confirm modal popup html*/ let html = `

`; jQuery(body).prepend(html); jQuery(modal_id + .modal-body).html(msg); jQuery(modal_id).modal(show); jQuery(modal_id + ubuy-confirm-modal-btn1).off(click); jQuery(modal_id + ubuy-confirm-modal-btn1).on(click, function (e) e.preventDefault(); jQuery(modal_id).modal(hide); cb(); ); ; function is_captcha_valid() if (jQuery(g-recaptcha-response).val() != ) jQuery(g-recaptcha-error).remove(); return true; else if (jQuery(g-recaptcha-error).length

Please verify that you are not a robot.

); return false; function recaptchaSuccess() is_captcha_valid(); function showErrors(errors) jQuery(.validation-advice).remove(); jQuery.each(errors, function (key, msg) jQuery(*[name= + key + ]).after(

); ); function submit_file_form_ajax(formelm, callback) if(!jQuery(formelm).valid()) return false; var formData = new FormData(formelm); jQuery.ajax( url: jQuery(formelm).attr(action), type: POST, data: formData, cache: false, contentType: false, processData: false, dataType: json, beforeSend: function () showLoaderImage(); , success: function (resp) if (resp.type == success) if ssage) success_flash_message(resp.message); else if (resp.errors) showErrors(resp.errors); if (resp.message) error_flash_message(resp.message); if (callback) callback(resp); if (resp.redirect) location.href= resp.redirect; , complete: function (resp) hideLoaderImage(); ); return false; function submit_form_ajax(formelm, callback) if(!jQuery(formelm).valid()) return false; jQuery.ajax( url: jQuery(formelm).attr(action), dataType: json, type: POST, data: jQuery(formelm).serialize(), beforeSend: function () showLoaderImage(); , success: function (resp) if (resp.type == success) if (resp.message) success_flash_message(resp.message); else if (resp.errors) showErrors(resp.errors); if (resp.message) error_flash_message(resp.message); if (callback) callback(resp); if (resp.redirect) location.href= resp.redirect; , complete: function (resp) hideLoaderImage(); ); return false; function fullnameAttribute() var maxlength = 64; jQuery(newsletter-subscribe-email [name=name]).attr(maxlength,maxlength); jQuery(v3-name).attr(maxlength,maxlength); jQuery(contactForm name).attr(maxlength,maxlength); jQuery(document).ready(function() fullnameAttribute(); );

Take upto 15% OFF on your first purchase.

Take upto 15% OFF on your first purchase.

); return true; function fallbackCopyToClipboard() if (window.clipboardData && window.clipboardData.setData) // Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. return clipboardData.setData(Text, text); else if (document.queryCommandSupported && document.queryCommandSupported(copy)) var textArea = document.createElement(textarea); // textarea.textContent = text; textArea.value = text; //textarea.style.position = fixed; // Prevent scrolling to bottom of page in Microsoft Edge. document.body.appendChild(textArea); textArea.focus(); textArea.select(); jQuery(ccode).select(); try return document.execCommand(copy); // Security exception may be thrown by some browsers. catch (ex) console.warn(Copy to clipboard failed., ex); return false; finally document.body.removeChild(textArea); function copyToClipboard(text) if (!navigator.clipboard) return fallbackCopyToClipboard(); navigator.clipboard.writeText(text).then(function () return true; , function (err) return false; ); return true; var ubNLS = getJsCookie(ubNLS); jQuery(document).ready(function () if (ubNLS == active) ubNewsletterCouponCodeBlock.modal(show); unsetJsCookie(ubNLS); ); window.addEventListener(load, function(event) validateForm(newsletter-pop-up-v1-form); validateForm(newsletter-pop-up-v2-form); validateForm(newsletter-popup-v3-form); ); if (ubNLS != active && window.location.href== jQuery(window).on(load, function () if (hasNewsletterNextOpenTime() && 0) setTimeout(function () var nlV = getTodayNewsletter(); toggleNewsletterBlock(nlV); setCookieNewsletter(nlV); newsletterTracking(nlV, opened); , 8000); ); window.addEventListener(load, function () jQuery(.dismiss-newsletter-popup).click(function () var ubNewsletterBlock = jQuery(this).closest(.ub-newsletter-block); var ubNv = ubNewsletterBlock.attr(ub-version); closeNewsletterBlock(ubNv); newsletterTracking(ubNv, declined); setCookieNewsletterSubscriber(); ); ); function closeNewsletterBlock(version) var ubNewsletterBlock = jQuery(.ub-newsletter-block[ub-version= + version + ]); ubNewsletterBlock.modal(hide); function toggleNewsletterBlock(version) var ubNewsletterBlock = jQuery(.ub-newsletter-block[ub-version= + version + ]); ubNewsletterBlock.modal(show); function setCookieNewsletter(version) var hasValid = false; cookieNewsletter = getCookieNewsletter(); if (cookieNewsletter) var cookies = JSON.parse(cookieNewsletter); var d = new Date(); if ((cookies.nextOpenTime – d.getTime())

0) hasValid = true; if (hasValid == false) var expires = getCookieExpires(365); vd = new Date(); var nextOpenTime = vd.getTime() + (0 * 24 * 60 * 60 * 1000); var ubNL = JSON.stringify(email: , version: version, nextOpenTime: nextOpenTime, isSubscribed: false); setJsCookie(ubNL, ubNL, expires); function setCookieNewsletterSubscriber(email) cookieNewsletter = getCookieNewsletter(); if (cookieNewsletter) var cookies = JSON.parse(cookieNewsletter); vd = new Date(); var nextOpenTime = vd.getTime() + (1 * 24 * 60 * 60 * 1000); if (email) cookies.email = email; cookies.isSubscribed = true; nextOpenTime = vd.getTime() + (30 * 24 * 60 * 60 * 1000); cookies.nextOpenTime = nextOpenTime; cookieNewsletter = JSON.stringify(cookies); var ubNL = cookieNewsletter; var expires = getCookieExpires(365); setJsCookie(ubNL, ubNL, expires); function getCookieNewsletter() return getJsCookie(ubNL); function hasNewsletterNextOpenTime() var hasNextOpenTime = true; var cookieNewsletter = getCookieNewsletter(); if (cookieNewsletter) cookieNewsletter = JSON.parse(cookieNewsletter); var d = new Date(); if ((cookieNewsletter.nextOpenTime – d.getTime())

0) hasNextOpenTime = false; return hasNextOpenTime; function getTodayNewsletter() cookieNewsletter = getCookieNewsletter(); if (cookieNewsletter) return v3; cookieNewsletter = JSON.parse(cookieNewsletter); return cookieNewsletter.version; else return v3; var nlI = (Math.random()

; default: return break; function showToast(message, type) var extraText = ; toastElm = jQuery(toast-pop-up); var icon_html = getIconHtml(type); if (type == success) toastElm.addClass(bd-success); extraText =

To help ensure it was you who subscribed, please check your inbox.

You will already be receiving our email newsletter full of latest deals, new international brands and awesome products.

+ extraText; toastElm.find(.modal-body).html(toast_html); toastElm.modal(show); setTimeout(function () toastElm.modal(hide); , 5000); function saveNewsletter(version, formElm) if (!jQuery(formElm).valid()) return false; document.getElementById(version + -btn-newsletter).innerHTML =

Please wait…; event.preventDefault(); var name = jQuery(input[name= + version + -name]).val(); var email = jQuery(input[name= + version + -email]).val(); if(version == v3) var gender = jQuery( + version + -gender option:selected).val(); else var gender = jQuery(input[name= + version + -gender]:checked).val(); jQuery.ajax( type: POST, data: name: name, email: email, gender: gender, version: version, , url: dataType: json, success: function (response) var type = error; var toastType = danger; var is_show_toast = true; if (response.success == true) type = success; toastType = success; if(response.auto_confirm) is_show_toast = false; jQuery(ub-newsletter-coupon-code-auto-confirm).modal(show); newsletterTracking(version, type); setCookieNewsletterSubscriber(email); else if (response.success == false && response.warning == true) toastType = warning; newsletterTracking(version, type); setCookieNewsletterSubscriber(email); else toastType = error; if (toastType == error) jQuery(newsletter-error-message- + version).removeClass(d-none).text(response.message); jQuery( + version + -btn-newsletter).text(jQuery( + version + -btn-newsletter).data(text)); else jQuery(newsletter-error-message- + version).addClass(d-none); if(is_show_toast) showToast(response.message, toastType) closeNewsletterBlock(version); , error: function (jqXHR, textStatus, errorThrown) closeNewsletterBlock(version); ); function newsletterTracking(version, type) var unstac = ns; if (type == declined) unstac = nd; else if (type == opened) unstac = no; var si = 1; var wi = 1; jQuery.ajax( type: POST, data: unstac: unstac, si: si, wi: wi, version: version, , url: dataType: json, success: function (response) , error: function (jqXHR, textStatus, errorThrown) ); $(newsletter-pop-up-v1).on(shown.bs.modal, function (e) $(body).addClass(modal-visible); $(body).css(padding-right, 0px); // $(newsletter-pop-up-v1).css(padding-right, 0px); $(newsletter-pop-up-v1).addClass(newsletter-modal); ) $(newsletter-pop-up-v1).on(hide.bs.modal, function () $(newsletter-pop-up-v1).removeClass(newsletter-modal); ); jQuery(document).on(keypress, .email-valid, function (event) if (event.which == 32) event.preventDefault(); ); jQuery(document).on(paste, .email-valid, function (e) var text = e.originalEvent.clipboardData.getData(Text); if (text.substring(text.indexOf( )).length) jQuery(this).val(text.replaceAll( , )); e.preventDefault(); );

Leave a Reply