Swatch Watches | Official UK Stockist: WatchO™ (2024)

  • Home
  • WATCHES

Join the Swatch Club for new launches & exclusive offers:

Filter by

No filters applied

  • 1
  • 2
  • Next
  • Recently Viewed

"; // var setvalue = response.data[0].section_heading; // console.log(setvalue); // $(".similar-products-block-heading").html(setvalue); strContent += "

"; $.each(response.data, function(key, value) { var currentClass = currentProduct == value.id? "active-similar-product":""; var source = "src='"; source += value.image; source += "'"; var url = value.url; window.location.host if (url.indexOf("//") > -1) { urls = url.split('/'); urls[2] = window.location.host; } else { urls = url.split('/'); urls[0] = window.location.host; } urls.join("/"); var href = "href='"; //href += productDetail.url; href += urls.join("/"); href += "'"; strContent += " \n\ Swatch Watches | Official UK Stockist: WatchO™ (61)"; if(value.reviews_count != undefined && value.reviews_count.reviews_count != undefined && value.reviews_count.reviews_count > 0 ){ strContent +="

\n\ \n\ \n\ \n\ \n\ \n\ ("+value.reviews_count.reviews_count+")

"; } strContent += ""; }); strContent +="

"; $('section.similar-products-block').append([strContent]); }); } function getProductReviews(currentProduct, groupName){ if(currentProduct == undefined){ return; } var url ="https://script.google.com/macros/s/AKfycbw69N_aM0XCP3lTYPgokQoFEYvEX6a52Wq4ZyU0Xg6SCFAnRn4/exec"; var data = {searchIds: currentProduct}; $.ajax({ url: url, method: 'GET', dataType: 'json', async: false, data: data, headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' } }).done(function (response) { if(response.data != undefined && response.data.data.reviews_count != undefined && response.data.data.reviews_count > 0){ var reviewCount = response.data.data.reviews_count; var strContent ="

\n\ \n\ \n\ \n\ \n\ \n\ ("+reviewCount +")

"; $(".product-in-similar-category-tn."+currentProduct+"[data-group='"+groupName+"'] a").append(strContent); } }).fail(function (jqXHR, exception) { }) } var CsObj = { config: function() { // flag for shipping calculation this.enableShippingCalculation = true; // flag for discount calc this.enableDiscounts = true; // flag for soldout form this.enableOutOfStockFormSubmit = true; // flag for Country-wise offer panel this.hideOfferPanelForOtherCountry = true; // flag to manage delivery Messages this.showDeliveryMessage = true; // flag to manage voucher discount amount this.showVoucherDiscount = true; // Flag to show similar products this.enableSimilarProducts = true; this.enableWhyChooseUs = true; this.enableRecentlyViewed = true; this.enablePopularProductBybrand = true; this.enableNominationMessage = true; //flag to manage reviews this.enableDelightedReviews = true; // flag for signup to newsletter form on product detail page this.enableSignupToNewsletter = true; this.useSignupToNewsletter2 = true; this.plantaTreeLocalStorageObj = 'PlantATreeProductLikes'; this.deliveryMessages = { 'Delivery-message-USA': 'Estimated delivery in 5 business days. View Delivery Costs', 'Delivery-message-Canada': 'Estimated delivery in 5 business days. View Delivery Costs', 'Delivery-message-Australia': 'Estimated delivery in 7 business days. View Delivery Costs', 'Delivery-message-EU-8': 'Estimated delivery in 5 business days. View Delivery Costs', 'Delivery-message-EU-12': 'Estimated delivery in 7 business days. View Delivery Costs', 'Delivery-message-Other': 'View Delivery Costs', }; this.enable5_7DayDelivery = true; this.monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; this.dayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; }, init: function(context) { if(context ==undefined) context = []; this.context = context; this.country = 'GB'; // current hour this.cHour = new Date().getHours(); // current day 0-sun,1-monday etc... this.cDay = new Date().getDay(); // Current Date this.cDate = new Date(); this.unitTest = false; this.currentDeliveryMessage = ''; this.expressDeliveryClass = '.p-day-delivery.express-delivery'; this.satDeliveryClass = '.p-day-delivery.sat-delivery'; this.get_preorder_product_list=setInterval(this.getPreOrderProductList(),1000); this.config(); this.showDiscountedPrice(); this.showVoucherDiscountPrice(); this.getCountry(); this.showSimilarProducts(); //this.showWhyChooseUs(); this.showRecentlyViewed(); this.showCustomDelivery(); this.showProductViews(); this.showPopularProductByBrand(); this.showSignupToNewsletter(); // this.showDelightedReviews(); this.showDelightedReviews([]); this.getPlantATreeLikeStatus(); _this = this; // TODO chirag 07-04-2023 upvote functionality _this.showLikeCounts(); $('[data-notify-in-stock]').on('click', function(){ _this.submitOutOfStock(); }); $("body").on('click','.price_drop_submit_btn',function(){ _this.submitPriceDropAlert(); }) $("body").on('click','.click_n_collect_submit_btn',function(){ _this.submitClickAndCollect(); }) $("body").on('click','.price_match_submit_btn',function(){ _this.submitPriceMatch(); }) $("body").on('click', ".plant-like-btn.like", function(){ console.log('from click'); _this.likePlantATree(); }); // TODO chirag 07-04-2023 upvote functionality $("body").on('click', ".upvote", function(){ _this.upvoteProduct(); }); function extendedWarrantyDisplay(){ let currentUrl = location.href.toLowerCase(); if(currentUrl.search('garmin-')==-1){ if($(".show_in_mob").is(":visible")){ $('.free-extended-warranty-mobile-block').show(); }else{ $('.extented_warranty_container').show(); } } } function extendedWarrantyDisplay(){ let currentUrl = location.href.toLowerCase(); if(currentUrl.search('victorinox-')==-1){ if($(".show_in_mob").is(":visible")){ $('.free-extended-warranty-mobile-block').show(); }else{ $('.extented_warranty_container').show(); } } } var currentHostName = document.location.host; //if (currentHostName.search('watcho.glopalstore.com') == -1) { if (currentHostName == "www.watcho.co.uk") { $('.click_n_collect').show(); // $('#finance_box').show(); //chirag todo 30-01-2023 $('#offer_delivery_block').show(); extendedWarrantyDisplay(); } else{ if(document.location.pathname.indexOf('Seiko') >0 || document.location.pathname.indexOf('seiko') > 0){ var newlocation = window.location.pathname; if(window.location.pathname.endsWith("/")){ newlocation = newlocation.slice(0,-1); } window.location.href = ("https://"+"www.watcho.co.uk"+newlocation); } $('#finance_box').remove(); var banner_visible_website = ["ie-watcho.glopalstore.com", "ca-watcho.glopalstore.com", "us-watcho.glopalstore.com","au-watcho.glopalstore.com"]; if(banner_visible_website.indexOf(currentHostName) > -1){ extendedWarrantyDisplay(); } } $("body").on('click','#price_alert_btn',function(){ $('.common_form_box').slideUp(500); $('.price_drop_form_container').slideDown(500); }) $("body").on('click','#bracelet_adjustment',function(){ $('.common_form_box').slideUp(500); $('.bracelet_adjustment_container').slideDown(500); }) $("body").on('click','#price_match_btn',function(){ $('.common_form_box').slideUp(500); $('.price_match_form_container').slideDown(500); }) $(document).on('click','#finance_btn',function(){ /*$('.common_form_box').slideUp(500); $('.finance_form_container').slideDown(500);*/ }) // $(document).on('click','#close_price_drop',function(){ // $('.price_drop_form_container').slideUp(400); // }) $("body").on('click','.ClickNCollectButton',function(){ $('.common_form_box').slideUp(500); $('.click_n_collect_form_container').slideDown(500); }) // $(document).on('click','#close_click_n_collect',function(){ // $('.click_n_collect_form_container').slideUp(400); // }) $("body").on('click','.close_form',function(){ $(this).closest('.common_form_box').slideUp(400); }) var currentHours = this.calcTime('+1'); $(document).ready(function(){ if( !$(".desktop-block-view").is(":visible") ){ $("section.videoGallery .toggleLink.is-open").removeClass("is-open"); $("section.videoGallery .toggle-content.is-open").removeClass("is-open"); } if(CsObj.country != 'OTHER' && (currentHours.getHours()>= 9 && currentHours.getHours() <=17) && currentHours.getDay() != 6 && currentHours.getDay() !=0) { //$(".productpricematch").show(); } else { //$(".productpricematch").hide(); } }) }, getPlantATreeLikeStatus: function(){ processLikePlantATreeStatus('get'); if (localStorage.getItem(this.plantaTreeLocalStorageObj) === null || localStorage.getItem(this.plantaTreeLocalStorageObj) === undefined) { return true; } var retrieverObject = localStorage.getItem(this.plantaTreeLocalStorageObj); if (Number(retrieverObject) > 0){ $(this).removeClass("like"); $(".plant-tree-like-button").addClass("like-clicked"); } }, likePlantATree: function(){ console.log('from function'); if (localStorage.getItem(this.plantaTreeLocalStorageObj) === null || localStorage.getItem(this.plantaTreeLocalStorageObj) === undefined) { var retrieverObject = []; } else { var retrieverObject = localStorage.getItem(this.plantaTreeLocalStorageObj); } console.log('from function retrieverObject 1 ', retrieverObject); retrieverObject = Number(retrieverObject) + 1 console.log('from function retrieverObject 2 ', retrieverObject); localStorage.setItem(CsObj.plantaTreeLocalStorageObj, retrieverObject); console.log('from function localStorage ', localStorage); processLikePlantATreeStatus('set'); }, // 07-04-2023 TODO chirag for loading time like counts showLikeCounts: function() { var productTitle = $('.productView-title').html(); var productId = $("#product_id").val(); var data = {product_title: productTitle, product_id: productId, isPageLoad: 1}; const likeStatus = localStorage.getItem('like-status-'+productId); if(likeStatus == "liked") { $(".heart-icon1").attr("src", "https://www.watcho.co.uk/product_images/uploaded_images/heart-icon-like-fill.png"); }else{ $(".heart-icon1").attr("src", "https://www.watcho.co.uk/product_images/uploaded_images/heart-icon-like.png"); } // var url ="https://script.google.com/macros/s/AKfycbyjp-d3w27VQ0pjU5u4Hbk4oZmHjyMba3xxFOpUXqGZeHJR9DE3jkFprMIcQSKin_qR/exec"; // local test 10 on local 06-04-2023 var url = "https://script.google.com/macros/s/AKfycbwoxLVJ5H3cHKKf3Fsp1mCUp6vqmNdiWmxsJB8T_8-Cjd8KCBbZcKvPI9p6NTUy-i-o/exec"; // Live 20-04-2023 $.ajax({ url: url, method: 'GET', dataType: 'json', data: data, headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, beforeSend: function() { $('.loader').removeClass('hidden') }, complete: function(){ $('.loader').addClass('hidden') }, }).done(function (response) { if(response.result != undefined && (response.result == "count fetched success")) { var text = "Like"; if(response.counts > 1) { text = "Likes"; } $(".like-count-text").text(response.counts + " "+text); } }).fail(function (jqXHR, exception) { console.log('error', exception); }) }, // 06-04-2023 TODO chirag for upvote upvoteProduct: function() { var productId = $("#product_id").val(); const likeStatus = localStorage.getItem('like-status-'+productId); var likeUnlikeStatus = 0; if (likeStatus) { if (likeStatus === 'liked') { likeUnlikeStatus = 1; } if (likeStatus === 'disliked') { likeUnlikeStatus = 0; } } var website = window.location.origin; var $form = 'form#ContactForm.PL20'; var productTitle = $("h1.productView-title").contents().not($("h1.productView-title").children()).text().replace(/\n/g, ""); var data = {product_title: productTitle, product_id: productId, count: 1, isPageLoad: 0, website: website, likeUnlikeStatus: likeUnlikeStatus}; if(likeUnlikeStatus == 0) { // var url ="https://script.google.com/macros/s/AKfycbyjp-d3w27VQ0pjU5u4Hbk4oZmHjyMba3xxFOpUXqGZeHJR9DE3jkFprMIcQSKin_qR/exec"; // local test 1 on local 11-04-2023 var url = "https://script.google.com/macros/s/AKfycbwoxLVJ5H3cHKKf3Fsp1mCUp6vqmNdiWmxsJB8T_8-Cjd8KCBbZcKvPI9p6NTUy-i-o/exec"; // Live 20-04-2023 $.ajax({ url: url, method: 'GET', dataType: 'json', data: data, headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, beforeSend: function() { $('.loader').removeClass('hidden') }, complete: function(){ $('.loader').addClass('hidden') }, }).done(function (response) { if (likeStatus) { localStorage.removeItem("like-status-"+productId); } localStorage.setItem('like-status-'+productId, response.likeUnlikeStatus); if(response.result != undefined && (response.result == "update success" || response.result == "created success")) { if(response.likeUnlikeStatus == "liked") { $(".heart-icon1").attr("src", "https://www.watcho.co.uk/product_images/uploaded_images/heart-icon-like-fill.png"); }else{ $(".heart-icon1").attr("src", "https://www.watcho.co.uk/product_images/uploaded_images/heart-icon-like.png"); } var text = "Like"; if(response.counts > 1) { text = "Likes"; } $(".like-count-text").text(response.counts + " " +text); } }).fail(function (jqXHR, exception) { // alert('Error ' + exception); }) } else { return false; } }, showProductViews: function(){ var MinCountRequired = 50; var VisibilitySeconds = 10; var currentProduct = $('input[name=product_id]').val(); if(currentProduct == undefined){ return; } var url ="https://script.google.com/macros/s/AKfycbyLbZl0-so-gQSLuBa-WkzdZf0oDF4cbfnfr346uKLhxMOheUFd/exec"; var data = {searchUrl: window.location.pathname}; $.ajax({ url: url, method: 'GET', dataType: 'json', data: data, headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' } }).done(function (response) { if(response.data != undefined && response.data[0].count >= MinCountRequired) { var remainder = response.data[0].count % 10; if(remainder != 0 ){ response.data[0].count = (response.data[0].count-remainder); } if(response.data[0].count >= 50 && response.data[0].count < 100){ view_text = 'Popular this week'; }else if(response.data[0].count >= 100 && response.data[0].count < 300){ view_text = 'Very popular this week'; }else if(response.data[0].count >= 300){ view_text = 'Trending this week'; }else{ response.data[0].count = response.data[0].count.toString()+ "+" ; view_text = response.data[0].count+" people viewed this in a week"; } //$(".view-count span").html("Viewed "+response.data[0].count+" times"); //$(".view-count span").html(response.data[0].count+" people viewed this in a week"); $(".view-count span").html(view_text); $(".view-count").show('slow'); //setTimeout(function(){ $(".view-count").hide('slow'); }, VisibilitySeconds*1000); } }).fail(function (jqXHR, exception) { }) }, showWhyChooseUs: function(){ if(!this.enableWhyChooseUs){ return false; } var prodData = $(".productView").data(); if(prodData == undefined) { return false; } //$(`.PSProdWhyChooseUsPanel.${prodData.productBrand.replace(" ","-").replace("'","")}`).show(); if(prodData.productBrand){ //$(".PSProdWhyChooseUsPanel."+prodData.productBrand.replace(" ","-").replace("'","")).show(); } }, calShipping: function() { if (!this.enableShippingCalculation) { return false; } if (this.country === 'GB') { //if ($(`${this.expressDeliveryClass}:visible`).length <= 0) { if ($(this.expressDeliveryClass+":visible").length <= 0) { return false; } this.showUkShipping(); } else { this.hideUkShipping(); } }, showUkShipping: function() { if ($(this.expressDeliveryClass+":visible").length) { // Adjust Delivery Day var dayAdd; var holidayDeliveryDatesAdjustment = false; // date override to enable holiday shipping settings /* var d1 = new Date(); var date1 = d1.getDate(); if ((date1 >= 27) || (date1 <= 1) ) { holidayDeliveryDatesAdjustment = true; //console.log ("holiday delivery enabled"); } */ //var currentBrand2 = $(".productView").data('product-brand'); if(holidayDeliveryDatesAdjustment) { //console.log ("holiday shipping enabled"); switch (this.cDay) { case 0:// For Sunday Delivery dayAdd = 3; break; case 1:// For Monday dayAdd = this.cHour < 15 ? 2 : 2; break; case 2:// For Tuesday dayAdd = this.cHour < 15 ? 1 : 2; break; case 3:// For Wednesday dayAdd = this.cHour < 15 ? 1 : 6; break; case 4:// For Thursday dayAdd = this.cHour < 15 ? 5 : 6; break; case 5:// For Friday dayAdd = this.cHour < 13 ? 5 : 5; break; case 6:// For Saturday dayAdd = 4; break; default: dayAdd = 2; break; } } else { //console.log ("standard shipping enabled"); switch (this.cDay) { case 0:// For Sunday Delivery dayAdd = 2; break; case 1:// For Monday case 2:// For Tuesday case 3:// For Wednesday dayAdd = this.cHour < 16 ? 1 : 2; break; case 4:// For Thursday dayAdd = this.cHour < 16 ? 1 : 4; break; case 5:// For Friday dayAdd = this.cHour < 15 ? 3 : 4; //dayAdd = this.cHour < 21 ? 3 : 4; break; case 6:// For Saturday dayAdd = 3; break; } } // Decide saturday Delivery switch (this.cDay) { case 4: if (this.cHour < 15) { this.hideSatDelivery(); } else { //holiday saturday delivery this.showSatDelivery(); //this.hideSatDelivery(); } break; case 5: if (this.cHour >= 15) { this.hideSatDelivery(); } else { //holiday saturday delivery this.showSatDelivery(); //this.hideSatDelivery(); } break; default: this.hideSatDelivery(); break; } // Calculate develivery dates var day = 60 * 60 * 24 * 1000 * dayAdd; this.deliveryDate = new Date(this.cDate.getTime() + day); var stmt = this.prepareExpressDeliveryStmt(this.deliveryDate); if (this.unitTest) { // console.log(`Current Date = ${this.cDate} --> Delivery Date: ${stmt}`); } else { $(".desktop-delivery "+this.expressDeliveryClass).html(stmt); stmt = this.prepareExpressDeliveryMobileStmt(this.deliveryDate); $(".mobile-delivery "+this.expressDeliveryClass).html(stmt); } } }, prepareExpressDeliveryStmt: function(deliveryDate) { var dt = this.dayNames[deliveryDate.getDay()]+", "+deliveryDate.getDate()+" "+this.monthNames[deliveryDate.getMonth()]+" "+deliveryDate.getFullYear(); //16.12.2022 Christmas Delivery return "Est Delivery on ".concat(dt); //return "Est Delivery on ".concat(dt, " or following day"); }, prepareExpressDeliveryMobileStmt: function(deliveryDate) { var dt = "".concat(this.dayNames[deliveryDate.getDay()], ", ").concat(deliveryDate.getDate(), " ").concat(this.monthNames[deliveryDate.getMonth()]); // 16.12.2022 Christmas Delivery return "Est on ".concat(dt); //return "Est Delivery on ".concat(dt, " or following day"); }, hideUkShipping: function() { $(this.expressDeliveryClass).hide(); //$(this.satDeliveryClass).hide(); $(".desktop-delivery ".concat(this.satDeliveryClass)).parent().hide(); $(".mobile-delivery ".concat(this.satDeliveryClass)).parent().hide(); $('.pricedeliveryreturns').hide(); }, hideSatDelivery: function() { //$(this.satDeliveryClass).hide(); $(".desktop-delivery ".concat(this.satDeliveryClass)).parent().hide(); $(".mobile-delivery ".concat(this.satDeliveryClass)).parent().hide(); }, showSatDelivery: function() { //alert('gs'); var dd = 0 - new Date().getDay(); var day = 60 * 60 * 24 * 1000 * dd; var cDate = new Date(new Date().getTime() + day); day = 60 * 60 * 24 * 1000 * 6; var satDeliveryDate = new Date(cDate.getTime() + day); var dt = "".concat(this.dayNames[satDeliveryDate.getDay()], ", ").concat(satDeliveryDate.getDate(), " ").concat(this.monthNames[satDeliveryDate.getMonth()]); var stmt = "Delivery on ".concat(dt, ". Order by Fri 2 PM."); if (this.unitTest) { //console.log(`Current Date = ${this.cDate} --> Delivery Date: ${stmt}`); } else { $(".desktop-delivery ".concat(this.satDeliveryClass)).html(stmt); //console.log(`Current Date = ${this.cDate} --> Delivery Date: ${stmt}`); stmt = "Delivery on ".concat(dt, ". Order by Fri 2 PM."); $(".mobile-delivery ".concat(this.satDeliveryClass)).html(stmt); $(this.satDeliveryClass).show(); } }, showDiscountedPrice: function() { if (!this.enableDiscounts) { return false; } // Show dicounted price with percentage if ($('.price.price--saving').html().length <= 0) { return false; } this.smProduct = {}; var retailPrice= $(".productView-details .productView-price .price-section--withTax span[data-product-rrp-with-tax='']").html(); retailPrice= retailPrice.replace(/^\s\s*/, '').replace(/\s\s*$/, '').replace(/^\D+/g, ''); if (retailPrice=== '') { return false; } this.smProduct.retailPrice = retailPrice.replace(',',''); var regularPrice= $('.price.price--withTax').html(); regularPrice= regularPrice.replace(/^\s\s*/, '').replace(/\s\s*$/, '').replace(/^\D+/g, ''); if (regularPrice=== '') { return false; } this.smProduct.regularPrice = regularPrice.replace(',',''); var percentSaved = Math.round((1 - parseFloat(this.smProduct.regularPrice / this.smProduct.retailPrice)) * 100); if (percentSaved > 0) { $('.price-section--saving.price .price:eq(0)').html('You save'); $('.price-section--saving.price .price:nth-child(3)').html(" ("+percentSaved+"%)"); $('.price-section--saving').show(); } }, getCountry: function() { // 280121 starts /* var currentHost = document.location.host; */ let currentHost = document.location.host; if (currentHost !== "www.watcho.co.uk") { if (currentHost.search('glopalstore.com') !== -1) { currentHost = currentHost.split('.glopalstore.com'); } else { currentHost = currentHost.split('.watcho.co.uk'); } // 280121 ends this.country = 'OTHER'; this.currentDeliveryMessage = ''; this.setMsgFlagForPrice = false; switch (currentHost[0]) { case 'ca-watcho': case 'ca': this.currentDeliveryMessage = 'Delivery-message-Canada'; break; case 'au-watcho': case 'au': this.currentDeliveryMessage = 'Delivery-message-Australia'; break; case 'at-watcho': case 'at': this.currentDeliveryMessage = 'Delivery-message-EU-12'; this.setMsgFlagForPrice = true; break; case 'be-watcho': case 'be': this.currentDeliveryMessage = 'Delivery-message-EU-8'; this.setMsgFlagForPrice = true; break; case 'de-watcho': case 'de': this.currentDeliveryMessage = 'Delivery-message-EU-8'; this.setMsgFlagForPrice = true; break; case 'es-watcho': case 'es': this.currentDeliveryMessage = 'Delivery-message-EU-12'; this.setMsgFlagForPrice = true; break; case 'fr-watcho': case 'fr': this.currentDeliveryMessage = 'Delivery-message-EU-8'; this.setMsgFlagForPrice = true; break; case 'ie-watcho': case 'ie': this.currentDeliveryMessage = 'Delivery-message-EU-8'; this.setMsgFlagForPrice = true; break; case 'it-watcho': case 'it': this.currentDeliveryMessage = 'Delivery-message-EU-12'; this.setMsgFlagForPrice = true; break; case 'pl-watcho': case 'pl': this.currentDeliveryMessage = 'Delivery-message-EU-8'; this.setMsgFlagForPrice = true; break; case 'ro-watcho': case 'ro': this.currentDeliveryMessage = 'Delivery-message-EU-8'; this.setMsgFlagForPrice = true; break; case 'us-watcho': case 'us': this.currentDeliveryMessage = 'Delivery-message-USA'; break; default: this.currentDeliveryMessage = 'Delivery-message-Other'; break; } // req 157 if(this.setMsgFlagForPrice == true){ var price = $('[itemprop="price"]').attr('content'); if(price>0){ $('#setMessageForPrice').removeAttr('style'); } } if (this.hideOfferPanelForOtherCountry) { //$('.pricesave-d').remove(); //$('.pricesave-d').hide(); this.enableDiscounts = false; // $('.price-section.price-section--saving.price').remove(); //$('.YouSave').hide(); $('.ReservePickupRow').hide(); } $("#seasonal-header-desktop-id2").remove(); $(".productpricematch").hide(); $(".click_n_collect").hide(); if (this.showDeliveryMessage && this.deliveryMessages[this.currentDeliveryMessage] != undefined && this.deliveryMessages[this.currentDeliveryMessage].length !== 0) { //$('.custom-delivery-message').html(this.deliveryMessages[this.currentDeliveryMessage]).show(); $('.custom-delivery-message').html('' + this.deliveryMessages[this.currentDeliveryMessage]).show(); $('.ps-price-addons').hide(); } this.enablePopularProductBybrand =false; if(this.enableNominationMessage && $(".productView").data('product-brand')=="Seiko"){ this.showNiminationMessage(); } } else if (currentHost === 'www.watcho.co.uk') { this.country = 'GB'; } if (this.enableShippingCalculation) { this.calShipping(); } }, /* seiko out of eu */ showNiminationMessage: function(){ $(".form-action.add-to-cart-block").prepend("

We can ship Seiko products only to a UK or EU address.
\n" + "Any orders for Seiko products requesting shipping outside UK and EU will be cancelled and refunded.

"); $(".form-action.add-to-cart-block #form-action-addToCart").remove(); }, testExpDelivery: function(hrs) { this.unitTest = 1; this.cHour = hrs; var dd = 0 - new Date().getDay(); var day = 60 * 60 * 24 * 1000 * dd; var cDate = new Date(new Date().getTime() + day); for (var i = 0; i <= 6; i++) { day = 60 * 60 * 24 * 1000 * i; this.cDay = i; this.cDate = new Date(cDate.getTime() + day); this.showUkShipping(); } }, submitOutOfStock: function() { if (this.enableOutOfStockFormSubmit === false) { return true; } var $form = 'form#ContactForm.PL20'; //var url = 'https://script.google.com/macros/s/AKfycbxIEq-n2dCpmEClWsXwGcAcHmF2DSTY7eOY37OK53qrxO-akdE/exec'; var url = 'https://script.google.com/macros/s/AKfycbwJ8y6_aH3Rm65zbYPLL7bjME4XFuF6wKnffo2CkFDBU9rITztp/exec'; var emailVal = $("".concat($form, " #contact_email")).val(); var productIdVal = $("".concat($form, " #product_id")).val(); if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailVal)) { $($form).parent().find('.formMessage').html('

Please enter valid email

'); return false; } //var data = { Email: emailVal, Product: $('.productView-title').html(), Phone: $(`${$form} #contact_phone`).val(), Site: 'Levens.com', Product_ID: productIdVal }; var data = { email: emailVal, product: $('.productView-title').html(), phone: $("".concat($form, " #contact_phone")).val(), product_id: productIdVal }; $.ajax({ url: url, method: 'GET', dataType: 'json', data : data, }).done(function() { $('#successmsg').html('

Thank you, your request has been received.

'); $('#aftersuccess').remove(); /* $($form).hide(); $($form).parent().find('.formMessage').html('

Thank You

'); */ }); return false; }, showVoucherDiscountPrice: function() { if (!this.showVoucherDiscount) { return false; } var calc = $('.p-price-after-voucher').data('calc'); if (calc === undefined) { return false; } if (calc.toLowerCase() !== 'yes') { return false; } var dataPrice = $('.p-price-after-voucher').data('price'); var dataPercent = $('.p-price-after-voucher:last').data('percent-off'); if (dataPrice === undefined || dataPercent === undefined) { return false; } var amt = (dataPrice - (dataPrice * dataPercent / 100)).toFixed(2); $('.p-price-after-voucher').html(" \xA3".concat(amt)).parent().show(); }, showPopularProductByBrand: function() { if(!this.enablePopularProductBybrand){ $("#div-tab-popular-product-by-brand").remove(); return false; } var brand_name=$(".productView").data().productBrand; if(brand_name!=undefined){ $("#popular-product").append(' '+brand_name); $("#div-tab-popular-product-by-brand").hide(); var listHtml = ''; var url = 'https://script.google.com/macros/s/AKfycbxIEq-n2dCpmEClWsXwGcAcHmF2DSTY7eOY37OK53qrxO-akdE/exec'; var data = { brandname: brand_name }; $.ajax({ url: url, method: 'GET', dataType: 'json', //async: false, data: data, headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, }).done(function(response){ if(response.result=="success"){ var i=0; var row_data=JSON.parse(response.row); var row_length=row_data.length; var caption=''; var image=''; var url=''; for(i=0; i

\n\

\n\ Swatch Watches | Official UK Stockist: WatchO™ (62) \n\

\n\ \n\ */ if(image!=undefined && image.length>0){ listHtml += '

'; listHtml+='

'; listHtml+='
'; listHtml+=''; listHtml+=''; listHtml+=''; listHtml+=''; listHtml+=''; listHtml+='
'; listHtml+='

'; listHtml+='

'+ (caption ? caption : '')+ '

'; listHtml+='

'; listHtml+='

'; listHtml+='

'; } } $(".popular-product-by-brand-lists").append(listHtml); if($(".popular-product-by-brand-lists .productCarousel-slide").length > 0){ //$(".tab-popular-product-by-brand").show(); } }else{ $("#div-tab-popular-product-by-brand").remove(); } }); }else{ $("#div-tab-popular-product-by-brand").remove(); } }, showSimilarProducts: function() { if (!this.enableSimilarProducts) { return false; } var currentProduct = $('input[name=product_id]').val(); currentProduct = parseFloat(currentProduct); // var groupLists = CsObjTags.getSimilarProductLists(currentProduct); // var key; // var productId; // var data = ''; // for (key in groupLists) { // if ({}.hasOwnProperty.call(groupLists, key)) { // data += "

".concat(key, "

"); // for (productId in groupLists[key]) { // if ({}.hasOwnProperty.call(groupLists[key], productId)) { // data += ""); // } // } // data += '

'; // } // } // $('section.similar-products-block').html(data); // for (key in groupLists) { // if ({}.hasOwnProperty.call(groupLists, key)) { // for (productId in groupLists[key]) { // /* if (currentProduct === groupLists[key][productId]) { // continue; // }*/ // //$(`.product-in-similar-category-tn[data-group='${key}']`).append(``); getSimilarProductDetail(currentProduct); // } // /*for (productId in groupLists[key]) { // getProductReviews(groupLists[key][productId], key); // }*/ // } // } }, // showSimilarProducts1: function() { // if (!this.enableSimilarProducts) { // return false; // } // var currentProduct = $('input[name=product_id]').val(); // currentProduct = parseFloat(currentProduct); // // console.log('currentProduct', currentProduct); // // getSimilarProductDetail(currentProduct); // var url = 'https://staging.consumer-sketch.com/watcho/public/api/groups/get'; // var data = {productId: currentProduct}; // $.ajax({ // url: url, // method: 'POST', // dataType: 'json', // crossDomain: true, // data: data, // }).done(function(groupLists) { // var data = ''; // for (key in groupLists) { // if ({}.hasOwnProperty.call(groupLists, key)) { // for (groupName in groupLists[key]) { // if ({}.hasOwnProperty.call(groupLists[key], groupName)) { // data += "

".concat(groupName, ":

\n\ //

"); // for (productDetailKey in groupLists[key][groupName]) { // var productDetail = groupLists[key][groupName][productDetailKey]; // var currentClass = currentProduct == productDetail.productId ? "active-similar-product" : ""; // //$(`.product-in-similar-category-tn[data-group='${groupName}'] .similar-product-${productId}`).append(` // data += "\n\ // "); // } // data += '

'; // } // } // } // } // $('section.similar-products-block').html(data); // }); // }, showRecentlyViewed: function(){ this.cookieName='aa'; if( !this.enableRecentlyViewed ){ return false; } var productId = $("input[name='product_id']").val(); var productData = this.getCookie(this.cookieName); var exist = false; var listHtml = ''; productData.forEach(function(element) { if(element.id == productId) { exist = true; } }); if(!exist && productId!= undefined){ if(productData.length>8){ productData.reverse().pop(); productData.reverse(); } productData.push({ /* title: $("h1.productView-title").html(),*/ img: $("ul.productView-thumbnails .lazyautosizes.lazyloaded:eq(0)").prop('src') != undefined ? $("ul.productView-thumbnails .lazyautosizes.lazyloaded:eq(0)").prop('src') : $("img.lazyload").data('src'), url: window.location.href, id: productId, brand: $(".productView").data().productBrand }); this.setCookie(this.cookieName,JSON.stringify(productData),30) } productData.reverse(); productData.forEach(function(element) { if(element.id == productId){ return; } /*

\n\ '+element.title+' \n\

\n\ */ listHtml = listHtml+ '

\n\

\n\
\n\ \n\ \n\ \n\ \n\ \n\
\n\

\n\

'+ (element.brand ? element.brand : '')+ '

\n\

\n\

\n\

'; }); productData.reverse(); $(".recently-viewed-lists").append(listHtml); if($(".recently-viewed-lists .productCarousel-slide").length > 0){ $(".tab-recently-viewed").show(); } }, setCookie: function(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); // Corrected calculation var expires = "expires="+ d.toGMTString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; }, getCookie: function(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i Please enter price'); return false; } if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailVal)) { $($form).parent().find('.formMessage').html('

Please enter valid email

'); return false; } $("".concat($form, " .price_drop_submit_btn")).attr('disabled','disabled'); $("".concat($form, " .price_drop_submit_btn")).val('Submitting...'); var current_price = $($form).closest('.productView').attr('data-product-price'); var data = { Customer_Email: emailVal, Product_Title: $('.productView-title').html(), Customer_Phone: $("".concat($form, " #contact_phone")).val(),Customer_Name: $("".concat($form, " #contact_name")).val(), Product_ID: productIdVal,Alert_At_Price:$("".concat($form, " #price")).val(),Product_URL:product_url,Current_Price:current_price }; $.ajax({ url: url, method: 'GET', dataType: 'json', data : data, }).done(function() { $('.price_drop_form_container').find('#PageContent').html('

Thank you, your message has been received!

'); }); return false; }, submitClickAndCollect: function() { var $form = 'form#click_n_collect_form'; var url = 'https://script.google.com/macros/s/AKfycbzSd_ra9Nu8dxaE9G2dAcI2hYB-PKgHvgjhjoVqSAzseVI0It_S/exec'; var emailVal = $("".concat($form, " #contact_email")).val(); var productIdVal = $("".concat($form, " #product_id")).val(); var product_url = $(location).attr('href').split('?')[0]; if (!$("".concat($form, " #contact_name")).val()) { $($form).parent().find('.formMessage').html('

Please enter name

'); return false; } if (!$("".concat($form, " #contact_phone")).val()) { $($form).parent().find('.formMessage').html('

Please enter phone

'); return false; } if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailVal)) { $($form).parent().find('.formMessage').html('

Please enter valid email

'); return false; } if (!$("".concat($form, " #date_of_collection")).val()) { $($form).parent().find('.formMessage').html('

Please enter collection date

'); return false; } $("".concat($form, " .click_n_collect_submit_btn")).attr('disabled','disabled'); $("".concat($form, " .click_n_collect_submit_btn")).val('Submitting...'); var current_price = $($form).closest('.productView').attr('data-product-price'); var collection_date = $("".concat($form, " #date_of_collection")).val().split("-").reverse().join("-"); var data = { Customer_Email: emailVal, Product_Title: $('.productView-title').html(), Customer_Phone: $("".concat($form, " #contact_phone")).val(),Customer_Name: $("".concat($form, " #contact_name")).val(), Product_ID: productIdVal,Collection_Date:collection_date,Product_URL:product_url,Current_Price:current_price }; $.ajax({ url: url, method: 'GET', dataType: 'json', data : data, }).done(function() { $('.click_n_collect_form_container').find('#PageContent').html('

Your request has been received. We will notify you when the product is ready for collection.

'); }); return false; }, submitPriceMatch: function() { var currentHours1 = this.calcTime('+1'); var $form = 'form#price_match_form'; var url = 'https://script.google.com/macros/s/AKfycbwUWQ1ByLdNP8kzfbwQ69Qn7MQ-Mj-C9TT7uuyNCIy5t-841Xw/exec'; var emailVal = $("".concat($form, " #contact_email")).val(); var productIdVal = $("".concat($form, " #product_id")).val(); var product_url = $(location).attr('href').split('?')[0]; var current_price = $($form).closest('.productView').attr('data-product-price'); if (!$("".concat($form, " #price_match_to")).val()) { $($form).parent().find('.formMessage').html('

Please enter Price-match to

'); return false; } if (!$("".concat($form, " #where_seen_price")).val()) { $($form).parent().find('.formMessage').html('

Please enter Where you have seen this price

'); return false; } if (!$("".concat($form, " #contact_name")).val()) { $($form).parent().find('.formMessage').html('

Please enter name

'); return false; } if (!$("".concat($form, " #contact_phone")).val()) { $($form).parent().find('.formMessage').html('

Please enter phone

'); return false; } if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailVal)) { $($form).parent().find('.formMessage').html('

Please enter valid email

'); return false; } $("".concat($form, " .price_match_submit_btn")).attr('disabled','disabled'); $("".concat($form, " .price_match_submit_btn")).val('Submitting...'); var data = { Customer_Email: emailVal, Product_Title: $('.productView-title').html(), Customer_Phone: $("".concat($form, " #contact_phone")).val(),Customer_Name: $("".concat($form, " #contact_name")).val(), Product_ID: productIdVal,Price_Match_To:$("".concat($form, " #price_match_to")).val(),Where_Seen:$("".concat($form, " #where_seen_price")).val(),Where_URL:$("".concat($form, " #page_url")).val(),Our_Product_URL:product_url,Our_Current_Price:current_price }; $.ajax({ url: url, method: 'GET', dataType: 'json', data : data, }).done(function() { var success_msg = '

Thank you for submitting price-match request. '; success_msg+='

If we are able to match the price, we will notify by email or phone. This usually takes 2-3 working hours on business days.

'; if(currentHours1.getHours()>= 9 && currentHours1.getHours() <=17 && currentHours1.getDay() != 6 && currentHours1.getDay() !=0) { success_msg+='

If you would like a quicker response, CHAT WITH US (During business hours)

'; } $('.price_match_form_container').find('#PageContent').html(success_msg); }); return false; }, getPreOrderProductList:function(){ //req - 131 updatePreOrderStockView(); }, showSignupToNewsletter:function(){//req - 141 if(this.enableSignupToNewsletter==true){ var canPurchaseProduct = ""; var currentProduct = $('input[name=product_id]').val(); var brand_name=$(".productView").data().productBrand; var brandDisc=getBrandCoupon(currentProduct); if(brandDisc==undefined){ brandDisc=getBrandCoupon(brand_name); } if(brand_name!=undefined && brandDisc!=undefined && brandDisc!="" && brandDisc.showform==true && brandDisc.discount_percentage>0){ if(brandDisc.signup_link_msg.length>0){ var singup_link_msg=brandDisc.signup_link_msg; }else{ var singup_link_msg="to our newsletter and save "+brandDisc.discount_percentage+"% on this product today."; } if(brandDisc.form_header_msg.length>0){ var form_header_msg=brandDisc.form_header_msg; }else{ var form_header_msg="Sign-up to our newsletter and save "+brandDisc.discount_percentage+"% on this product today."; } $("#pdiscountTagId").text(form_header_msg); var linkhtml=' \n\ \n\ '+brandDisc.discount_percentage+'% OFFSign-up '+singup_link_msg+'\n\ '; if(canPurchaseProduct!=undefined && (canPurchaseProduct=='true' || canPurchaseProduct==true)){ $("#newsletter-signup").css('display','block'); //$(".desktop-delivery").before(linkhtml); $(".product-page-plant-wrapper").before(linkhtml); } } } }, showDelightedReviews: function(reviews){ if(!this.enableDelightedReviews){ return false; } if(reviews.length<4) return; $("div.product-review-wrapper").append(`

Hear it from our customers

`); $("div.product-review-wrapper .review-content").append('
    '); var fiveStartRatting = `

    `; htmlContent =`
  • ${fiveStartRatting}
  • `; $("div.product-review-wrapper .review-content ul").append(htmlContent + `
  • 6400+ Reviews.
  • Feefo
  • Google
  • TrustPilot
  • Store
  • `); reviews.forEach(function(el,i){ var date = new Date(el.service.created_at); $("div.product-review-wrapper .review-content .delighting-review-slider").append( `
    ${fiveStartRatting}
    ${el.service.title != undefined? el.service.title : ''}

    ${el.service.review}

    ${el.customer != undefined?'By ' + el.customer.display_name: ''} ${dateDiffrence(el.service.created_at) <= 7 ? 'On ' + date.getDate().toString().padStart(2, "0") +'/'+ (date.getMonth() + 1).toString().padStart(2, "0") + '/' + date.getFullYear(): ''}

    ` ); }); $.fn.slick = window.customSlick; $(".product-review-wrapper").show(); $('.delighting-review-slider').slick({ dots: true, infinite: false, speed: 300, slidesToShow: 3, slidesToScroll: 3, responsive: [ { breakpoint: 1100, settings: { slidesToShow: 2, slidesToScroll: 2, arrows: true, dots: true, } }, { breakpoint: 580, settings: { slidesToShow: 1, slidesToScroll: 1, arrows: true, dots: true, } } ] }); }, getFeFooReviews: function(){ var settings = { "async": true, "crossDomain": true, "url": "https://api.feefo.com/api/20/reviews/all?merchant_identifier=watcho-online&rating=5&page_size=12&page=1", "method": "GET", } return $.ajax(settings) ; }, } function dateDiffrence(date){ const date1 = new Date(date); const date2 = new Date(); const diffTime = Math.abs(date2 - date1); const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); return diffDays; } // pre order products and coming soon products function updatePreOrderStockView(){ //req- 131 var product_id=$("#product_id").val(); if(product_id!=undefined){ clearInterval(this.get_preorder_product_list); var pre_order_product_list={ //'12442':{'desktop_preorder_now_btn_display': false,'mobile_preorder_now_btn_display':false}, }; if(pre_order_product_list[product_id]!=undefined){ var desktop_preorder=pre_order_product_list[product_id]['desktop_preorder_now_btn_display']; var mobile_preorder=pre_order_product_list[product_id]['mobile_preorder_now_btn_display']; var instructionLabel="Enter your email address to be notified when available in stock."; if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { //its mobile view if(mobile_preorder==true){ $("#form-action-addToCart").css('display','block'); $("#outofstocklable1").css('display','block'); $("#outofstocklable2").css('display','block'); }else{ $("#outofstocklable1").text(instructionLabel); $("#outofstocklable1").css('display','block'); $("#outofstocklable2").remove(); } }else{ //alert(pre_order_product_list[product_id]['desktop_preorder_now_btn_display']); if(desktop_preorder==true){ $("#form-action-addToCart").css('display','block'); $("#outofstocklable1").css('display','block'); $("#outofstocklable2").css('display','block'); }else{ $("#outofstocklable1").text(instructionLabel); $("#outofstocklable1").css('display','block'); $("#outofstocklable2").remove(); } } }else{ $("#form-action-addToCart").css('display','block'); $("#outofstocklable1").css('display','block'); $("#outofstocklable2").css('display','block'); } } } function openReviewBox(){ if($(".goolge_feefo_review").is(":visible")){ $('.goolge_feefo_review').slideUp(500); } else{ $('.goolge_feefo_review').slideDown(500); } } function submitSubscribeToBrand() { var $form = 'form#subscribe_brand_form'; var url = 'https://script.google.com/macros/s/AKfycbwGShN82EgMVR4BHxUOtho2D32sFdb3a5XyyZn2dT6rqmzDAdA/exec'; var emailVal = $("".concat($form, " #contact_email")).val(); if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailVal)) { $($form).parent().find('.formMessage').html('Please enter valid email'); return false; } var page_url = $(location).attr('href').split('?')[0]; var brand_name = $('.dnt_missout_new_product').attr('product-brand'); $("".concat($form, " .subscribe_to_brand_btn")).attr('disabled','disabled'); $("".concat($form, " .subscribe_to_brand_btn")).val('Submitting...'); var data = { Customer_Email: emailVal, Brand: brand_name, Subscribed_From_Page:page_url }; $.ajax({ url: url, method: 'GET', dataType: 'json', data : data, }).done(function() { $('.dnt_missout_new_product').html('

    Thank you, your message has been received!

    ').fadeOut(5000); }); return false; } $("body").on('click','.subscribe_to_brand_btn',function(){ submitSubscribeToBrand(); }) //start req - 141 signup subscribe function getBrandCoupon(brandname){ var brands = { /* "THE ELECTRICIANZ":{"showform":true,'discount_percentage':5,'signup_link_msg':'to our newsletter and save 5% on this product today.','form_header_msg':'Sign-up to our newsletter and save 5% on this product today.'}, */ /* "Edifice":{"showform":true,'discount_percentage':5,'signup_link_msg':'to our newsletter and save 5% on this product today.','form_header_msg':'Sign-up to our newsletter and save 5% on this product today.'}, */ /* "STORM":{"showform":true,'discount_percentage':15,'signup_link_msg':'to our newsletter and save 15% on this product today.','form_header_msg':'Sign-up to our newsletter and save 15% on this product today.'}, */ /* "Garmin":{"showform":true,'discount_percentage':10,'signup_link_msg':'to our newsletter and save 10% on this product today.','form_header_msg':'Sign-up to our newsletter and save 10% on this product today.'}, */ "Fiorelli":{"showform":true,'discount_percentage':10,'signup_link_msg':'to our newsletter and save 10% on this product today.','form_header_msg':'Sign-up to our newsletter and save 10% on this product today.'}, /* Garmin 2 models no form */ /* */ /* */ /* 2582-11 no form */ /* */ /* */ }; return brands[brandname]; } function signupToNewsletter(){ var source_url=window.location.href; var btnSubscribeValue=$("#btnSubscribeToNewsletter").val(); if($("#first_nameError").length){ $("#first_nameError").remove(); } if($("#last_nameError").length){ $("#last_nameError").remove(); } if($("#subscribetonewsletter_emailError").length){ $("#subscribetonewsletter_emailError").remove(); } if($("#notgenerate_couponError").length){ $("#notgenerate_couponError").remove(); } var hasErrorCount = 0; var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; var first_name=$.trim($("#first_name").val()); var last_name=$.trim($("#last_name").val()); var subscribetonewsletter_email=$("#subscribetonewsletter_email").val(); if(first_name=="" || first_name.length==0) { $("#first_name").after('Enter your first name.'); hasErrorCount++; } if(last_name=="" || last_name.length==0) { $("#last_name").after('Enter your last name.'); hasErrorCount++; } if(subscribetonewsletter_email=="" || subscribetonewsletter_email.length==0) { $("#subscribetonewsletter_email").after('Enter a valid email address.'); hasErrorCount++; }else if(!emailReg.test(subscribetonewsletter_email)) { $("#subscribetonewsletter_email").after('Enter a valid email address.'); hasErrorCount++; } if(hasErrorCount==0){ $("#btnSubscribeToNewsletter").val('Submitting...'); $("#btnSubscribeToNewsletter").attr('disabled',true); var currentProduct = $('input[name=product_id]').val(); var product_title = $('.productView-title').html(); var product_price = $('.price.price--withTax').html().replace(/^\s\s*/, '').replace(/\s\s*$/, '').replace(/^\D+/g, ''); var coupon_code=generaterandomstring('N'+currentProduct,3); var brand_name=$(".productView").data().productBrand; var brandDisc=getBrandCoupon(currentProduct); if(brandDisc==undefined){ brandDisc=getBrandCoupon(brand_name); } //var brandDisc=getBrandCoupon(brand_name); var discount_percentage=brandDisc.discount_percentage; var cdate = new Date(); cdate.setDate(cdate.getDate() + 4); //var newdate=cdate.toLocaleString('en-GB', { timeZone: 'Europe/London' }); var getMonth=cdate.getMonth()+1; if(getMonth<=9){ getMonth='0'+getMonth; } var currentDateTime=getActualCurrentDateTime(); var current_date_time=currentDateTime.split(" "); var currentDate=current_date_time[0]; var currentTime=current_date_time[1]; var expiryDate=cdate.toUTCString(); var datastring={ "name":coupon_code, // discount_percentage+"% OFF each item in the order - "+ "type":"percentage_discount", "code":coupon_code, "enabled":true, "amount":discount_percentage, "max_uses":1, "max_uses_per_customer":1, "expires":expiryDate, "applies_to_entity":"products", "applies_to_ids":currentProduct, "applies_to":{ "entity":"products", "ids":[currentProduct] } }; var settings = { "async": true, "crossDomain": true, "url": "https://cors-anywhere.herokuapp.com/https://api.bigcommerce.com/stores/f06f69/v2/coupons", "method": "POST", "headers": { "accept": "application/json", "content-type": "application/json", "x-auth-token": "3al7oslx8l52o7fk8m77ugvtgg2jibh", "x-auth-client": "nvv1ptt9wdpo8szcak4li2y4nkm6evn" }, "processData": false, "data": JSON.stringify(datastring) } if(CsObj.useSignupToNewsletter2) { var settings = { "async": true, "crossDomain": true, //"url": "https://script.google.com/macros/s/AKfycbyHq3uR-kM_NnJjvRr8grUD5EhQWSNWYU_UpOTIVzMDoXs_Wd_msUV3/exec", 08/02/2023 "url" :"https://script.google.com/macros/s/AKfycbwrbPXTgA_YjjKtPWNB6JTQtuN-jnLseZM-Jq-o-QBsHBM8Q7eve4FbvN6h852Ul3RtpA/exec", "method": "GET", "dataType": 'json', "data": datastring } } //Step -1 entry into google sheet var subject=encodeURIComponent('Sign-up Confirmation & Your Voucher Code Enclosed'); var datastring='currentDate='+currentDate+'&currentTime='+currentTime+'&first_name='+first_name+'&last_name='+last_name+'&email='+subscribetonewsletter_email+'&brand='+brand_name+'&product_id='+currentProduct+'&product_title='+product_title+'&product_price='+product_price+'&coupon_code='+coupon_code+'&subject='+subject+'&source_url='+source_url; //var url = 'https://script.google.com/macros/s/AKfycbwUMjWNRVv4xkjxM2SRH8qDNa3bknYj0noiJVez_L0JlkVyQjU6/exec'; //temp //var url = 'https://script.google.com/macros/s/AKfycbzzq9b2oPNJRZpyDqEaQFqez6W1ylfmLxgqmpteaUzxIo21S7vCP75qUavNfIezaoVbRA/exec'; var url = "https://script.google.com/macros/s/AKfycbxuVdm4g05D1aiy1nP7E89KO8BTbvjV6oM2wc-XcC9UeghzWS3d/exec"; var url = "https://script.google.com/macros/s/AKfycbxzSfW67C2bmrOAG43T8F7diVV853ls0MMWTOa2D4YU0HNpBOQC6cpsS18AHznIgQJ9RQ/exec"; var url = "https://script.google.com/macros/s/AKfycbzXCZfiEaawi_gIVe7n0y4St-2OE9qaqZ6ABNqwptDwMTBxDWMlZC10YqrK-TPn3wj43A/exec"; $.ajax({ url: url, method: 'GET', dataType: 'json', data : datastring, success:function(response){ $("#first_name").val(''); $("#last_name").val(''); $("#subscribetonewsletter_email").val(''); $('#btnSubscribeToNewsletter').val(btnSubscribeValue); $('#btnSubscribeToNewsletter').attr('disabled',false); $("#subscribetoNewsletterSuccessMsg").css('display','block'); $("#span_coupon_code").text(coupon_code); }, error:function (xhr, ajaxOptions, thrownError){ console.log(xhr.status); console.log(thrownError); } }); //step 2 - entry for coupon code via bigcommerce API $.ajax(settings).done(function (response) { console.log(response); }); } } //end req - 141 $(document).ready(function(){ $('.allColor').hide(); $('.no-reviews').show(); $('.more-reviews-block').hide(); $(document).off('click').on('click', '.more', function () { if ($('.more-reviews-link').hasClass('less')) { $('.more-reviews-link').text('More Reviews').append('>').removeClass('less'); $('ul > li.productReview:gt(' + CsObj.pageReview + ')').hide(); $('ul > li.productReview').eq(CsObj.pageReview).parents('.review-content.toggleable').nextAll('.review-content').hide(); } else { $('.more-reviews-link').text('Less Reviews').append('<').addClass('less'); $('ul > li.productReview').eq(CsObj.pageReview).parents('.review-content.toggleable').nextAll('.review-content').show(); $('ul > li.productReview:gt(' + CsObj.pageReview + ')').show(); } // $('li.productReview').siblings('li.toggleable').slideToggle(); // $('ul > li.productReview').parents('.review-content.toggleable').slideToggle(); $('ul > li.productReview').parents('.review-content.toggleable').toggle('slow'); }); }); function getActualCurrentDateTime(){ var newdate = new Date(); var current_date_time=newdate.toLocaleString('en-GB', { timeZone: 'Europe/London' }); current_date_time=current_date_time.replace(',', ''); return current_date_time; } function generaterandomstring(stringtojoin='NX',length=1){ //generate random strings var d = new Date(); var currentTime=d.getTime(); // declare all characters //let characters ='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+currentTime+'abcdefghijklmnopqrstuvwxyz'; let characters ='ABCDEFGHIJKLMNO'+currentTime+'PQRSTUVWXYZ'; let result = ''; let charactersLength = characters.length; for ( let i = 0; i < length; i++ ) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } if(stringtojoin!=""){ result=stringtojoin+result; } return result; }

    '); // Create benefits container benefits.forEach(function (benefit) { // You can use CSS to style the circle or provide an image // Define benefit description var benefitDescription = ''; if (benefit === '5-Year Warranty') { benefitDescription = '5 Year Warranty'; } else if (benefit === 'Free Gift') { benefitDescription = 'Free Gift'; } else if (benefit === 'Warranty Extended To 3 Years') { benefitDescription = 'Free Extended Warranty to 3 years'; } else if (benefit === 'Warranty Extended To 4 Years') { benefitDescription = 'Free Extended Warranty to 4 years'; } else if (benefit === 'Free Add-on Strap') { benefitDescription = 'Free Strap'; } else if (benefit === 'Warranty Extended To 5 Years') { benefitDescription = 'Free Extended Warranty to 5 years'; } else if (benefit === 'Warranty Extended To 8 Years') { benefitDescription = 'Free Extended Warranty to 8 years'; } // Create benefit item with icon and description var $benefitItem = $('

    '); var $titleoncategory = ""; if(isCategoryPage == false) { $titleoncategory = benefitDescription; } var $icon = $('Swatch Watches | Official UK Stockist: WatchO™ (67)'); if (isCategoryPage == true) { var $description = $('

    '); } $benefitItem.append($icon).append($description); // Append benefit item to container $benefitsContainer.append($benefitItem); }); // Insert benefits container after the target element $(targetSelector).after($benefitsContainer); } } // Display benefits on product details page var currentProductId = $('input[name=product_id]').val(); displayBenefits(currentProductId, '.slider-wrapper.product-slick-wrapper', true); // Iterate over each product container on category page $('.product').each(function () { // Extract product ID var productId = $(this).find('.card').data('entity-id'); // Target the appropriate element to display benefits var benefitsTarget = $(this).find('.custom_for_benefits_msg'); // Display benefits for each product displayBenefits(productId, benefitsTarget, false); }); // Function to get benefit icon URL function getBenefitIconUrl(benefit) { switch (benefit) { case '5-Year Warranty': return 'https://cdn11.bigcommerce.com/s-f06f69/images/stencil/original/image-manager/5year.png?t=1712062283'; case 'Free Gift': return 'https://cdn11.bigcommerce.com/s-f06f69/images/stencil/original/image-manager/gift.png?t=1712062157'; case 'Warranty Extended To 3 Years': return 'https://cdn11.bigcommerce.com/s-f06f69/images/stencil/original/image-manager/2-1year.png?t=1712151023'; case 'Warranty Extended To 4 Years': return 'https://cdn11.bigcommerce.com/s-f06f69/images/stencil/original/image-manager/3-1year.png?t=1712151021'; case 'Free Add-on Strap': return 'https://cdn11.bigcommerce.com/s-f06f69/images/stencil/original/image-manager/belt.png?t=1712293397'; case 'Warranty Extended To 5 Years': return 'https://cdn11.bigcommerce.com/s-f06f69/images/stencil/original/image-manager/4-1-year.png?t=1712293399'; case 'Warranty Extended To 8 Years': return 'https://cdn11.bigcommerce.com/s-f06f69/images/stencil/original/image-manager/2-6-years.png?t=1712667897'; default: return ''; // If no matching benefit icon found } } });

    Swatch Watches | Official UK Stockist: WatchO™ (2024)
    Top Articles
    Latest Posts
    Article information

    Author: Tuan Roob DDS

    Last Updated:

    Views: 6604

    Rating: 4.1 / 5 (62 voted)

    Reviews: 85% of readers found this page helpful

    Author information

    Name: Tuan Roob DDS

    Birthday: 1999-11-20

    Address: Suite 592 642 Pfannerstill Island, South Keila, LA 74970-3076

    Phone: +9617721773649

    Job: Marketing Producer

    Hobby: Skydiving, Flag Football, Knitting, Running, Lego building, Hunting, Juggling

    Introduction: My name is Tuan Roob DDS, I am a friendly, good, energetic, faithful, fantastic, gentle, enchanting person who loves writing and wants to share my knowledge and understanding with you.