Accessories & Phone Cases For Galaxy Z Flip 3 | Samsung UK (2022)

Accessories & Phone Cases For Galaxy Z Flip 3 | Samsung UK (1)
Accessories & Phone Cases For Galaxy Z Flip 3 | Samsung UK (2)
Accessories & Phone Cases For Galaxy Z Flip 3 | Samsung UK (8)
Accessories & Phone Cases For Galaxy Z Flip 3 | Samsung UK (13)
Accessories & Phone Cases For Galaxy Z Flip 3 | Samsung UK (14)

WHITE

BUY NOW

BUY NOW

'); } } else { // remove on class and price div from all parents children $(cta).closest('.buy-now-wrap').append('

' + main.comingSoonCopy + '

'); } }, doGetSkuInfoGpv2: function(sku, cta, cb) { console.log('gpv2 - ' + sku); var result = {}; // TODO // // NEED TO BE ABLE TO HANDLE > 1 SKU so on load we only hit syndicated product once // var skusData = { "skus": skus, "offset": 0, "count": 0, "component_flags": { var skusData = { "skus": [sku], "offset": 0, "count": 0, "component_flags": { "price": true, "promotion": false, "inventory": true, "v2_inventory": false, "delivery_modes": false, "payment_methods": false, "partner_attributes": false, "promotion_price": false } }; // var skusData = { "skus": [sku], "offset": 0, "count": 0 }; var url = '//www.samsung.com' + '/' + main.site + '/api/v4/configurator/syndicated-product'; $.ajax({ url: url, type: 'POST', data: JSON.stringify(skusData), dataType: 'json', contentType: 'application/json; charset=UTF-8', success: function(data) { if (data.products && data.products.length == 1 && data.products[0].price_info && data.products[0].price_info.length > 0) { var prodData = data.products[0]; var productCode = prodData.model_code; var price = null; var priceFormatted = null; var promotionPrice = null; var promotionPriceFormatted = null; if (prodData.price_info && prodData.price_info.length == 1) { price = prodData.price_info[0].msrp_price.value; priceFormatted = prodData.price_info[0].msrp_price.formatted_value; promotionPrice = null; promotionPriceFormatted = null; if (prodData.price_info[0].sale_price.value != prodData.price_info[0].msrp_price.value) { // only populate promotionPrice if sale price differs from msrp price - so we can use the same logic as hybris promotionPrice = prodData.price_info[0].sale_price.value; promotionPriceFormatted = prodData.price_info[0].sale_price.formatted_value; } } // Consider gpv2 values - InStock, OutOfStock, BackOrdered, PreOrder, NoOrder var stockLevelStatus = 'outOfStock'; var stockLevelStatusDisplay = main.outOfStockCopy; if (prodData.inventory) { if (prodData.inventory.status.toLowerCase() == 'instock' || prodData.inventory.status.toLowerCase() == 'backordered' || prodData.inventory.status.toLowerCase() == 'preorder') { stockLevelStatus = 'inStock'; stockLevelStatusDisplay = ''; // not used if not outOfStock } } result.productCode = productCode; result.price = price; result.priceFormatted = priceFormatted; result.promotionPrice = promotionPrice; result.promotionPriceFormatted = promotionPriceFormatted; result.stockLevelStatus = stockLevelStatus; result.stockLevelStatusDisplay = stockLevelStatusDisplay; cb(result); } else { cb(result); } }, error: function(o) { console.log('error! ' + sku, o); cb(result); } }) }, doGetSkuInfoHybris2: function(sku, cta, cb) { console.log('hybris2 - ' + sku); var result = {}; var params = "productCodes=" + sku + "&fields=SIMPLE_INFO"; $.ajax({ url: "https://p1-smn2-api-cdn.shop.samsung.com/tokocommercewebservices/v2/" + main.site + "/products?" + params, type: "GET", data: {}, dataType: "json", cache: !0, crossDomain: !0, timeout: 1e4, success: function(s) { if (s && s.length == 1) { var data = s[0]; // console.log(data); var productCode = data.code; var price = null; var priceFormatted = null; var promotionPrice = null; var promotionPriceFormatted = null; if (data.price) { price = data.price.value; priceFormatted = data.price.formattedValue; } if (data.promotionPrice) { promotionPrice = data.promotionPrice.value; promotionPriceFormatted = data.promotionPrice.formattedValue; } var stockLevelStatus = 'outOfStock'; var stockLevelStatusDisplay = main.outOfStockCopy; if (data.stock && data.stock.stockLevelStatus && (data.stock.stockLevelStatus.toLowerCase() == 'instock' || data.stock.stockLevelStatus.toLowerCase() == 'backorder' || data.stock.stockLevelStatus.toLowerCase() == 'preorder')) { stockLevelStatus = 'inStock'; stockLevelStatusDisplay = ''; // not used if not outOfStock } result.productCode = productCode; result.price = price; result.priceFormatted = priceFormatted; result.promotionPrice = promotionPrice; result.promotionPriceFormatted = promotionPriceFormatted; result.stockLevelStatus = stockLevelStatus; result.stockLevelStatusDisplay = stockLevelStatusDisplay; cb(result); } else { console.log('fail!'); cb(result); } }, error: function(o) { console.log('error! ' + sku, o); cb(result); } }) }, doGetSkuInfoHybris: function(sku, cta, cb) { console.log('hybris - ' + sku); var result = {}; var params = "productCodes=" + sku; $.ajax({ url: "https://shop.samsung.com" + "/" + main.site + "/servicesv2/getSimpleProductsInfo?" + params, type: "GET", data: {}, dataType: "jsonp", jsonpCallback: "jQuery12345678901234567890_" + sku.toLowerCase().replace('-', '').replace('/', ''), cache: !0, crossDomain: !0, timeout: 1e4, success: function(s) { if ("0000" == s.resultCode && s.productDatas && s.productDatas.length == 1) { var data = s.productDatas[0]; // console.log(data); if ("0000" == data.resultCode) { // console.log('success workings - ' + data.productCode); result.productCode = data.productCode; result.price = data.price; result.priceFormatted = data.priceFormatted; result.promotionPrice = data.promotionPrice; result.promotionPriceFormatted = data.promotionPriceFormatted; result.stockLevelStatus = data.stockLevelStatus; result.stockLevelStatusDisplay = data.stockLevelStatusDisplay; cb(result); } else { console.log('fail sku!'); cb(result); } } else { console.log('fail!'); cb(result); } }, error: function(o) { console.log('error! ' + sku, o); cb(result); } }) }, getCB: function() { // get cache buster var now = new Date(); var year = now.getFullYear(), month = now.getMonth() + 1, // months are zero indexed day = now.getDate(), hour = now.getHours(), minute = now.getMinutes(), second = now.getSeconds(); month = month < 10 ? "0" + month : month day = day < 10 ? "0" + day : day hour = hour < 10 ? "0" + hour : hour minute = minute < 10 ? "0" + minute : minute second = second < 10 ? "0" + second : second var cb = year + "" + month + "" + day + "" + hour + "" + minute + "" + second; return cb; }, doGetSkuInfoExertis: function(sku, cta, cb) { console.log('exertis - ' + sku); var result = {}; var checkerUrl = 'https://shop.samsung.com/ie/products/' + sku + '.json?cb=' + main.getCB(); $.getJSON(checkerUrl, function(data) { var price = null; var priceFormatted = null; var promotionPrice = null; var promotionPriceFormatted = null; result.productCode = data.reference; result.price = data.price; // need to remove € and , result.priceFormatted = data.price; // var sku = data.reference; // var price = data.price; // var url = data.url; // console.log(data); // need to change 'ADD TO BASKET' to 'SHOP NOW' var stockLevelStatus = 'outOfStock'; var stockLevelStatusDisplay = main.outOfStockCopy; if (data.stock) { stockLevelStatus = 'inStock'; stockLevelStatusDisplay = ''; // not used if not outOfStock } result.url = data.url; cb(result); }) .done(function() { // console.log("XXX - done"); }) .fail(function() { // console.log("XXX - fail"); console.log('error! ' + sku); cb(result); }) .always(function() { // console.log("XXX - always"); }); }, doAddToCart: function(sku) { if (main.platform == 'gpv2') { main.doAddToCartGpv2(sku); } else if (main.platform == 'hybris2') { main.doAddToCartHybris2(sku); } else { main.doAddToCartHybris(sku); } }, doAddToCartGpv2: function(sku) { var qs = '&addItem[]=' + sku + ',1'; var url = '//www.samsung.com' + '/' + main.site + '/web/cart/?' + qs; console.log('url for gpv2 - ' + url); window.location.href = url; }, doAddToCartHybris2: function(sku) { var url = 'https://p1-smn2-api-cdn.shop.samsung.com/tokocommercewebservices/v2/' + main.site + '/addToCart/multi?fields=DEFAULT&newCart=false&products%5B0%5D.productCode=' + sku + '&products%5B0%5D.qty=1&redirect=CART'; console.log('url for hybris2 - ' + url); window.location.href = url; }, showProgress: function() { // console.log('show progress'); $('.cm-configurator-loader').stop(true, true).show() }, hideProgress: function() { // console.log('hide progress'); $('.cm-configurator-loader').hide() }, doAddToCartHybris: function(sku) { var params = "products[0].productCode=" + sku + "&products[0].quantity=1"; main.showProgress(); $.ajax({ url: "https://shop.samsung.com" + "/" + main.site + "/ng/p4v1/addToCart?" + params, type: "GET", data: {}, dataType: "jsonp", jsonp: "callback", async: !1, timeout: 1e4, success: function(s) { main.hideProgress(); if ("0000" == s.resultCode) { // analytics on checkout button // var modelName = $('a[data-sku="' + sku + '"]').closest('.product-detail').data('product'); var modelName = sku.substr(0, 8); var dataOmni = ';' + modelName + '|' + sku; $('.configurator-item-added-popup .cm-configurator-popup__cta-inner a.s-cta-blue').attr('data-omni', dataOmni); $('.configurator-item-added-popup').show(); // $('.pd-popup-add-to-cart').show(); $('.js-empty-cart').hide(); $('.s-btn-utility.js-cart').show(); $('#globalCartCount').show(); updateTotalCartCount(s.cartCount); } else { console.log('fail!'); } }, error: function(o) { main.hideProgress(); console.log('error!'); } }) }, resetCta: function($item) { console.log($item); if (main.makeBuyable) { // only do if ... // $item IS the wrapping acc_list element main.doColor($item); /* // find the wrapping wrap-product element - parent of all var wrapProduct = $item.closest('.wrap-product'); // console.log('before - ' + wrapProduct.length); // find the currently visible product-detail (holder of color chips and ctas) var productDetail = wrapProduct.find('.product-detail:visible'); // console.log('before - ' + productDetail.length); // find the selected colour within the product detail d var selectColor = productDetail.find('.color-chip:visible a.on').data('color-code'); console.log('before - ' + selectColor); productDetail.find('.c_btn_learn_more a').removeClass('on'); var selectedColor = productDetail.find('.c_btn_learn_more:visible a[data-color-code="'+selectColor+'"]'); $(selectedColor).addClass('on'); main.doColor(selectedColor); console.log('after'); */ } }, doIt: function() { console.log('galaxy.makeAccessoriesBuyable.main.doIt'); $('#contents').addClass('buyable'); if (main.platform == 'gpv2') { // } else { $('.configurator-item-added-popup').hide(); // $('.pd-popup-add-to-cart').hide(); main.hideProgress(); $('.cm-configurator-popup__cta-inner .cm-configurator-popup-closer').on('click', function(e) { e.preventDefault(); $('.configurator-item-added-popup').hide(); }); $('.cm-configurator-popup__cta-inner .s-cta-blue').on('click', function(e) { e.preventDefault(); console.log('hide the popup before going to the page'); $('.configurator-item-added-popup').hide(); main.showProgress(); window.location.href = "https://shop.samsung.com" + "/" + main.site + "/cart"; }); } // NOTE - c_btn_pre-type2 NOT c_btn_pre-type1 like it was for note10 $('.buy-now-wrap a.c_btn_f3').off('click'); $('.buy-now-wrap a.c_btn_f3').on('click', function(e) { // check if linking or if adding to cart - href vs sku var sku = $(this).data('sku'); var href = $(this).attr('href'); console.log(sku + ' ' + href); if (sku) { e.preventDefault(); // console.log('add to Basket - ' + sku); main.doAddToCart(sku); } else { // console.log('go to ' + href); } }) // initialise ctas // kd done above ... // main.initCtas(); }, }; return { main: main }; })(); window.GALAXY_IS_ASYNC=true; ;(function(win,doc,callback){'use strict';callback=callback||function(){};function detach(){if(doc.addEventListener){doc.removeEventListener('DOMContentLoaded',completed)}else{doc.detachEvent('onreadystatechange',completed)}}function completed(){if(doc.addEventListener||event.type==='load'||doc.readyState==='complete'){detach();callback(window,window.jQuery)}}function init(){if (doc.addEventListener){doc.addEventListener('DOMContentLoaded',completed)}else{doc.attachEvent('onreadystatechange',completed)}}init()})(window,document,function(win,$){ $.ajaxSetup({cache:true}); $.ajax('/samsung/resources/global/galaxy-z-flip3-5g/common/js/plugins.min.js') .then(function(){return $.ajax('/samsung/resources/global/galaxy-z-flip3-5g/common/js/common.min.js')}) .then(function(){return $.ajax('/samsung/resources/global/galaxy-z-flip3-5g/common/js/localization/common.min.js')}) .then(function(){ // Call here so that is NOT using - the redundant divs are removed window.galaxy.makeAccessoriesBuyable.main.init(); // //

] const faqList = function() { let $section = $('.m_faq-banner'), $item_q, $item_a, $item_btns; const omni = { open: ':expand:', close: ':collapse:' }; const asset = function() { $item_q = $section.find('.faq_item_q'); $item_a = $section.find('.faq_item_a'); $item_btns = $item_q.find('button'); } const addEvent = function() { $item_btns.off('click').on('click', showContent); } const init = function() { if ( !$section.length ) { return false; } asset(); addEvent(); return this; } const showContent = function() { const $item_btn = $(this); const curIndex = $item_btns.index(this); const $item = $item_btn.closest('.faq_item'); const omniture = this.dataset.omni; if ( !$item.hasClass('is-open') ) { $item.addClass('is-open'); $item_btn.attr({ 'aria-expanded': 'true', 'ga-la': omniture.replace(omni.open, omni.close), 'data-omni': omniture.replace(omni.open, omni.close) }); $item_a.eq(curIndex).stop().slideDown(); } else { $item.removeClass('is-open'); $item_btn.attr({ 'aria-expanded': 'false', 'ga-la': omniture.replace(omni.close, omni.open), 'data-omni': omniture.replace(omni.close, omni.open) }); $item_a.eq(curIndex).stop().slideUp(); } GALAXY.omniture(omniture); return false; } init(); }; const disclaimer = function() { if ( !$('#desc-section').length ) { return false; } const $disclaimer = $('#desc-section'); const anthorTitle = $disclaimer.find('ol').data('title') || ''; const addEvent = function() { $(document).off('click.disclaimer').on('click.disclaimer', 'a.click_sup', action); }; const action = function(e) { let subnavHeight = $('#subnav, .floating-navigation__inner').height(); let $target = $( this.getAttribute('href') ); let moveTop = $target.offset().top - subnavHeight - 40; // padding-top 40; let $accessibility; $target.wrapInner( $('', {attr: {'tabindex': 0}}) ); $accessibility = $target.find('a'); $accessibility.focus().one('blur', function() { $target.html( $accessibility.html() ); }); GALAXY.setScrollTop( moveTop ); e.preventDefault(); }; const addAnthor = function() { let $sup = $(this); let val = $sup.html().split(','); let lens = val.length; let i=0, arr=[]; for (;i

'+ num +''); } $sup.html(arr.join(',')) }; const init = function() { let $sup = $('article[class^=m_feature] sup:not(.default)'); $disclaimer.find('li').each(function(i) { this.id = 'disclaimer' + (this.dataset.sup || i+1); }); $sup.each(addAnthor); }; init(); addEvent(); }; const focusInview = function() { let scrollValueCheck = null; const onAction = function(e) { if ( e.keyCode == 9 ) { let target = this.dataset.focusVsTarget || this; let $target = $(target); let scrollValue = $target.offset().top - GALAXY.areaHeight/2; GALAXY.setScrollTop( scrollValue ); clearTimeout(scrollValueCheck); scrollValueCheck = setTimeout(function(){ if ( GALAXY.scrollTop != scrollValueCheck ) { GALAXY.setScrollTop( scrollValue ); } },50); } }; $('#contents, .m_dotcom_footer').find('a, button, input, select').on('keyup.focusInView', onAction); }; window.onSatellite = function(value) { if (typeof _satellite != 'undefined') { _satellite.setVar('scrollTrack', value); _satellite.track('section_scroll_end'); } }; ;(function() { $('.m_feature_banners').each(function() { let visibleLens = $(this).find('>:visible ').length; $(this).removeClass('column1 column2 column3').addClass('column' + visibleLens); }); $('.m_feature_jump').each(function() { var $jump = $(this); var $list = $('.jump_contents>ul'); var $card = $list.find('.jump_card:visible'); var $prev = $('.jump_arrows a.prev'); var $next = $('.jump_arrows a.next'); var lens = $card.length; var maxView = 4; var obImageLazy = function(entries, observer) { $.each(entries, function(i, entry) { if ( entry.isIntersecting ) { var $images = $(entry.target).find('img'); $images.data('lazy', false); bannerResize(true); observer.unobserve( entry.target ); } }); } var bannerResize = function(force) { if ( force || (GALAXY.sizeMode && GALAXY.sizeMode != GALAXY.prevSizeMode)) { $card.each(function(i, li) { var $image = $(li).find('img'); if ($image.data('lazy') == false) { var imageUrl = GALAXY.setMediaBaseURL(GALAXY.getImageSources($image)[GALAXY.sizeMode]); if (typeof imageUrl == 'string') { $image.attr({'src': imageUrl }); } } }); } } var obImageInstance = new IntersectionObserver(obImageLazy, {root: null, rootMargin: '300%', thresholder: [0]}); obImageInstance.observe( this ); var slide = { init: false, index: 0, animation: false, interavl: null, maxView: (lens - maxView), prev: function(e) { if ( slide.animation ) { return false; } slide.animation = true; if ( slide.index == 0 ) { slide.animation = false; return false; } slide.index = slide.index - 1; slide.action(); e.preventDefault(); }, next: function(e) { if ( slide.animation ) { return false; } slide.animation = true; if ( slide.index >= slide.maxView ) { slide.animation = false; return false; } slide.index = slide.index + 1; slide.action(); e.preventDefault(); }, action: function() { slide.animation = true; slide.btnVisibleCheck(); var w = $card.width() + parseInt($card.eq(1).css('margin-left')); $list.__css({x: -w * slide.index}); GALAXY.setTransitionEndEvent($list, slide.end) }, btnVisibleCheck: function() { $prev.decideClass('hide', (slide.index == 0)); $next.decideClass('hide', (slide.index >= slide.maxView)); }, end: function() { slide.animation = false; } } if ( lens > 3 ) { $jump.addClass('cols4'); if ( lens > 4 ) { slide.init = true; $('.m_feature_jump .jump_arrows').show(); slide.index = Math.max(($card.filter('.on').index()+1 - maxView), 0); slide.action(); slide.btnVisibleCheck(); $prev.on('click', slide.prev); $next.on('click', slide.next); } } else { $jump.addClass('cols3'); $card.each(function(i, li) { var $image = $(li).find('img').data('lazy', true); if (i==0) { $image.attr({ 'data-media-s2': $image.attr('data-media-s2').replace('_m.png', '-v2_m.png') }) } $image.attr({ 'data-media-s4': $image.attr('data-media-s4').replace('.png', '-v2.png') }) }); } GALAXY.resize(function() { if ( slide.init && GALAXY.sizeMode > 2) { slide.interavl && clearTimeout(slide.interavl); slide.interavl = setTimeout(slide.action, 150); } bannerResize(); }); bannerResize(true); }); })(); GALAXY.load(function() { faqList(); disclaimer(); focusInview(); }); ; var accWrap = $('.acc_list_wrap') var accList = accWrap.find('.acc_list'); var currentName = accWrap.find('current-color'); var deviceName = accWrap.find('.device_btn a'); var colorChip = $('.acc_container .colorchip_item input[type=radio]'); /* Image load and change */ var prodImgLoad = function(e) { var $acc_list = $(this).hasClass('acc_list') ? $(this) : $(this).parents('.acc_list'); var dataName = $acc_list.data(); var dataFolder = $acc_list.closest('.acc_list_wrap').data('folder'); var nameArray = [dataName.models, dataName.prodName]; var prodImg = $acc_list.find('.prod-img figure'); var $altValue; var d_selected = $('#kv-type2').data('selected-title'); //img transition var imageChange = function(){ prodImg.find('.current-img').clone().removeClass('current-img').addClass('change-img').appendTo(prodImg); prodImg.find('.change-img').animate({opacity: 0}, 250, function(){ prodImg.find('.change-img').remove(); }); } //Change device current name currentName.addClass('change').animate({opacity:1}, 250, function(){ currentName.removeClass('change'); }); if ( $(this).hasClass('acc_list') ) { /* Load */ var checkedDefault = $(this).data('default-color'); //prodImage file name nameArray.push( dataName.defaultMm ); nameArray.push( dataName.defaultColor ); // device name - selected $('.device_btn.on a').attr('title', d_selected); // checked radio const checkedInput = $(this).find('.color_list .colorchip_item input[value=' + checkedDefault + ']'); if(checkedInput.length >0){ checkedInput[0].checked = true; const currentColor = $('').text(checkedInput.attr('aria-label')); $(this).find('.current-color').html(currentColor); } // alt value; $altValue = $(this).find('.color_list input:checked').data('img-alt'); }else if( $(this).parent('li').hasClass('device_btn')){ /* Device name change */ e.preventDefault(); var nowIdx = $(this).parent().index(); var d_colorChip = $(this).closest('.acc_list').find('.color_list'); var d_nowColor = $(this).closest('.acc_list').find('.color_list.on .colorchip_item input[type=radio]:checked').val(); var d_colorArray = $(this).closest('.acc_list').find('.color_list:not(.on)').data('color-array'); var d_defaultColor = $(this).closest('.acc_list').find('.color_list:not(.on)').data('device-default-color'); var buyNowWrap = $('.buy-now-wrap .watch-buy-wrap'); var buyNowIdx = deviceName.index(this); var colorIdx = $(this).closest('.acc_list').find('.color_list.on .colorchip_item input[type=radio]:checked').parent().index(); var buyBtnKeep = $(this).closest('.acc_list').find('.buy-now-wrap .watch-buy-wrap:not(.on) .buy-now-btn'); //device name change $(this).parent().addClass('on').siblings().removeClass('on'); $(this).attr('title', d_selected).parent().siblings().find('a').attr('title', ''); //selected d_colorChip.eq(nowIdx).addClass('on').siblings().removeClass('on'); // image transition - animation imageChange(); // buy now btn buyNowWrap.eq(buyNowIdx).addClass('on').siblings().removeClass('on'); // keep color chip if(d_colorArray.indexOf(d_nowColor) == -1){ var currentColor = $(this).closest('.acc_list').find('.current-color'); var defaultColor = $(this).closest('.acc_list').find('.color_list.on').data('device-default-color'); var upperDColor = defaultColor.charAt(0).toUpperCase() + defaultColor.slice(1); nameArray.push( $(this).parent('li').data('device')); nameArray.push( d_defaultColor); //current color name currentColor.children('span').text(upperDColor); currentColor.addClass('change').animate({opacity:1}, 250, function(){ currentColor.removeClass('change') }); $(this).closest('.acc_list').find('.color_list.on .colorchip_item input[value=' + d_defaultColor + ']')[0].checked = true; // alt value $altValue = $(this).closest('.acc_list').find('.color_list.on .colorchip_item input:checked').data('img-alt'); //buy now button var colorIdx2 = $(this).closest('.acc_list').find('.color_list.on .colorchip_item input[type=radio]:checked').parent().index(); buyBtnKeep.eq(colorIdx2).addClass('buy').siblings().removeClass('buy'); }else{ //prodImage file name nameArray.push( $(this).parent().data('device')); nameArray.push( d_nowColor); $(this).closest('.acc_list').find('.color_list.on .colorchip_item input[value=' + d_nowColor + ']')[0].checked = true; // alt value $altValue = $(this).closest('.acc_list').find('.color_list.on .colorchip_item input[value=' + d_nowColor + ']:checked').data('img-alt'); //buy now button buyBtnKeep.eq(colorIdx).addClass('buy').siblings().removeClass('buy'); } } else { /* Color-chip change */ //Change device current name var $this = $(this); var $accList = $this.closest('.acc_list'); var colorText = $this.attr('aria-label'); var currentColor = $accList.find('.current-color'); var buyNowBtn_w = $accList.find('.buy-now-wrap .watch-buy-wrap.on .buy-now-btn'); var buyNowBtn = $accList.find('.buy-now-wrap .buy-now-btn'); var buyIdx = $accList.find('.color_list.on .colorchip_item input').index(this); var buyIdx2 = $accList.find('.color_list .colorchip_item input').index(this); //current color name currentColor.children('span').text(colorText); currentColor.addClass('change').animate({opacity:1}, 250, function(){ currentColor.removeClass('change') }); //prodImage file name nameArray.push( $this.data('device-mm') ); nameArray.push( $this.val() ); // image transition - animation imageChange(); // alt value $altValue = this.dataset.imgAlt; //$(this).data('img-alt'); buyNowBtn_w.eq(buyIdx).addClass('buy').siblings().removeClass('buy'); buyNowBtn.eq(buyIdx2).addClass('buy').siblings().removeClass('buy'); } nameArray = nameArray.filter(function(v){ return(v !== undefined) }); altValue = $altValue; imgSrc = '//images.samsung.com/uk/smartphones/galaxy-z-flip3-5g/accessories/images/' + dataFolder +'/' + nameArray.join('_') + '.jpg'; imgSrc_m = '//images.samsung.com/uk/smartphones/galaxy-z-flip3-5g/accessories/images/' + dataFolder +'/' + nameArray.join('_') + '_m.jpg'; $acc_list.find('.prod-img .current-img').attr({ 'data-media-s4': imgSrc, 'data-media-s2': imgSrc_m, alt: altValue }); changeImage(); // var cta = $acc_list.find('.c_btn_f3:visible'); // console.log('xxxxx doColor - |' + cta.data('sku')); window.galaxy.makeAccessoriesBuyable.main.resetCta($acc_list); } /* Change Kv description & Buy now btn Layout */ var changeLayOut = function(){ var kvDesc = $('.m_content-kv .m_feature-kvdesc'); var kvDescAppend = $('.m_content-kv .m_article-kv'); var kvDescInit = $('.m_content-kv .f_container'); var addListBox1 = $('.acc_list_wrap.box1'); if( GALAXY.sizeMode <= 2 ){ if ( GALAXY.sizeMode && GALAXY.sizeMode != GALAXY.prevSizeMode ) { kvDesc.appendTo(kvDescAppend); addListBox1.each(function(){ var buyNowBtn = $(this).find('.buy-now-wrap'); var buyNowChange = $(this).find('.acc_list .acc_wrap'); buyNowBtn.appendTo(buyNowChange); }); } } else { if ( GALAXY.sizeMode && GALAXY.sizeMode != GALAXY.prevSizeMode ) { kvDesc.insertBefore(kvDescInit); addListBox1.each(function(){ var buyNowBtn = $(this).find('.buy-now-wrap'); var buyNowInit = $(this).find('.acc_header .acc_header-inner'); buyNowBtn.appendTo(buyNowInit); }); } } }; /* sub nav anchor moving */$('.acc-subnav a').on('click', function(e) {var $target = $($(this).attr('href'));var duration = 750;var onBlur = function() { this.removeAttribute('tabindex'); }if ( $target.length ) {GALAXY.setSmoothScrollTop( $target.offset().top, duration, function(){$target.attr({tabindex: -1}).focus().one('blur', onBlur);});}e.preventDefault();}); const changeImage = function() { if ( GALAXY.sizeMode ) { $('.acc_list .prod-img .current-img').each(function() { this.src = GALAXY.getImageSources($(this))[GALAXY.sizeMode]; }); } } accList.each(prodImgLoad); // default color colorChip.on('change', prodImgLoad); // change color colorChip.on('change', GALAXY.tracking); deviceName.on('click', prodImgLoad); //change device name GALAXY.resizeFunctions.push(changeImage, changeLayOut); ; // // // }).then(function(){GALAXY.initialize()}) }).then(function(){ GALAXY.initialize(); // Call here (second time) because now all default selections should be selected - so can get pricing etc if buyable window.galaxy.makeAccessoriesBuyable.main.init(); })});

You might also like

Latest Posts

Article information

Author: Catherine Tremblay

Last Updated: 07/22/2022

Views: 6341

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.