Shopify.quickshopOptionsMap4686409367654 = {}; Shopify.quickshopUpdateOptionsInSelector4686409367654 = function(selectorIndex) { switch (selectorIndex) { case 0: var key = 'root'; var selector = jQuery('#product-form-quick-4686409367654 .single-option-selector:eq(0)'); break; case 1: var key = jQuery('#product-form-quick-4686409367654 .single-option-selector:eq(0)').val(); var selector = jQuery('#product-form-quick-4686409367654 .single-option-selector:eq(1)'); break; case 2: var key = jQuery('#product-form-quick-4686409367654 .single-option-selector:eq(0)').val(); key += ' / ' + jQuery('#product-form-quick-4686409367654 .single-option-selector:eq(1)').val(); var selector = jQuery('#product-form-quick-4686409367654 .single-option-selector:eq(2)'); } var initialValue = selector.val(); selector.empty(); var availableOptions = Shopify.quickshopOptionsMap4686409367654[key]; if (availableOptions && availableOptions.length) { for (var i = 0; i < availableOptions.length; i++) { var option = availableOptions[i]; var newOption = jQuery('').val(option).html(option); selector.append(newOption); } jQuery('#product-form-quick-4686409367654 .swatch[data-option-index="' + selectorIndex + '"] .swatch-element').each(function() { if (jQuery.inArray(jQuery(this).attr('data-value'), availableOptions) !== -1) { jQuery(this).removeClass('soldout').show().find(':radio').removeAttr('disabled', 'disabled').removeAttr('checked'); } else { jQuery(this).addClass('soldout').hide().find(':radio').removeAttr('checked').attr('disabled', 'disabled'); } }); if (jQuery.inArray(initialValue, availableOptions) !== -1) { selector.val(initialValue); } selector.trigger('change'); } }; Shopify.quickshopLinkOptionSelectors4686409367654 = function(product) { // Building our mapping object. for (var i = 0; i < product.variants.length; i++) { var variant = product.variants[i]; //if (variant.available) { // Gathering values for the 1st drop-down. Shopify.quickshopOptionsMap4686409367654['root'] = Shopify.quickshopOptionsMap4686409367654['root'] || []; Shopify.quickshopOptionsMap4686409367654['root'].push(variant.option1); Shopify.quickshopOptionsMap4686409367654['root'] = Shopify.uniq(Shopify.quickshopOptionsMap4686409367654['root']); // Gathering values for the 2nd drop-down. if (product.options.length > 1) { var key = variant.option1; Shopify.quickshopOptionsMap4686409367654[key] = Shopify.quickshopOptionsMap4686409367654[key] || []; Shopify.quickshopOptionsMap4686409367654[key].push(variant.option2); Shopify.quickshopOptionsMap4686409367654[key] = Shopify.uniq(Shopify.quickshopOptionsMap4686409367654[key]); } // Gathering values for the 3rd drop-down. if (product.options.length === 3) { var key = variant.option1 + ' / ' + variant.option2; Shopify.quickshopOptionsMap4686409367654[key] = Shopify.quickshopOptionsMap4686409367654[key] || []; Shopify.quickshopOptionsMap4686409367654[key].push(variant.option3); Shopify.quickshopOptionsMap4686409367654[key] = Shopify.uniq(Shopify.quickshopOptionsMap4686409367654[key]); } //} } // Update options right away. Shopify.quickshopUpdateOptionsInSelector4686409367654(0); if (product.options.length > 1) Shopify.quickshopUpdateOptionsInSelector4686409367654(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector4686409367654(2); // When there is an update in the first dropdown. jQuery("#product-form-quick-4686409367654 .single-option-selector:eq(0)").change(function() { Shopify.quickshopUpdateOptionsInSelector4686409367654(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector4686409367654(2); return true; }); // When there is an update in the second dropdown. jQuery("#product-form-quick-4686409367654 .single-option-selector:eq(1)").change(function() { if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector4686409367654(2); return true; }); }; productsObj.id4686409367654 = {"id":4686409367654,"title":"DISCOVER DEVICE® Clip Cord 2.0M 2A","handle":"discover-clip-cord-2-0m-2a","description":"\u003cp\u003eDISCOVER DEVICE® Clip Cord 2.0M 2A\u003c\/p\u003e\n\u003cp\u003eA premium quality and durable cable is a master key to all high quality of tattoo machine,its high conductive brings stable electric to strong power.\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003e\u003cstrong\u003eIts outstanding features\u003c\/strong\u003e\u003cbr\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003e1.apply with high duty of copper wire assures for high conductive.\u003c\/li\u003e\n\u003cli\u003e2.precise complete injection molded of phono jack results in long last,anti-breakage.\u003c\/li\u003e\n\u003cli\u003e3.premium soft pvc cord is good to anti-knots.\u003c\/li\u003e\n\u003cli\u003e4.high durable and save expenses on the tattoo devices.\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cstrong\u003eIts parameter\u003c\/strong\u003e\u003cbr\u003e\n\u003cul\u003e\n\u003cli\u003e1.jack plug crafted from injection molded.\u003c\/li\u003e\n\u003cli\u003e2.length of cable:2m\u003c\/li\u003e\n\u003cli\u003e3.electric conduction:3A.\u003c\/li\u003e\n\u003cli\u003e4.net weight:70grams.\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eFor more details on offer and OEM services please drop message to us as soon as possible.\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003eThank you from the premium team\u003cbr\u003e\u003c\/p\u003e","published_at":"2020-03-25T16:58:15+08:00","created_at":"2020-03-25T17:24:56+08:00","vendor":"Discover Device","type":"Tattoo Accessories","tags":[],"price":2295,"price_min":2295,"price_max":2295,"available":true,"price_varies":false,"compare_at_price":null,"compare_at_price_min":0,"compare_at_price_max":0,"compare_at_price_varies":false,"variants":[{"id":31521265778790,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"1324-BK","requires_shipping":true,"taxable":false,"featured_image":{"id":14299450900582,"product_id":4686409367654,"position":6,"created_at":"2020-03-25T17:25:21+08:00","updated_at":"2020-03-25T17:26:00+08:00","alt":null,"width":1000,"height":1000,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-BK_Discover.jpg?v=1585128360","variant_ids":[31521265778790]},"available":true,"name":"DISCOVER DEVICE® Clip Cord 2.0M 2A - Black","public_title":"Black","options":["Black"],"price":2295,"weight":100,"compare_at_price":null,"inventory_management":"shopify","barcode":"745396546182","featured_media":{"alt":null,"id":6474278142054,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-BK_Discover.jpg?v=1585128360"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":31521265811558,"title":"Gray","option1":"Gray","option2":null,"option3":null,"sku":"1324-GY","requires_shipping":true,"taxable":false,"featured_image":{"id":14299450736742,"product_id":4686409367654,"position":5,"created_at":"2020-03-25T17:25:19+08:00","updated_at":"2020-03-25T17:25:59+08:00","alt":null,"width":1000,"height":1000,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-GY_Discover.jpg?v=1585128359","variant_ids":[31521265811558]},"available":true,"name":"DISCOVER DEVICE® Clip Cord 2.0M 2A - Gray","public_title":"Gray","options":["Gray"],"price":2295,"weight":100,"compare_at_price":null,"inventory_management":"shopify","barcode":"745396546199","featured_media":{"alt":null,"id":6474277978214,"position":5,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-GY_Discover.jpg?v=1585128359"}},"requires_selling_plan":false,"selling_plan_allocations":[]}],"images":["\/\/discoverdevice.com\/cdn\/shop\/products\/1324-BKDiscover.jpg?v=1585128476","\/\/discoverdevice.com\/cdn\/shop\/products\/1324-GYDiscover.jpg?v=1585128476","\/\/discoverdevice.com\/cdn\/shop\/products\/Discover1_23232db3-7098-4156-81c7-49fe6faf36d6.jpg?v=1585128476","\/\/discoverdevice.com\/cdn\/shop\/products\/Discover.png?v=1585128359","\/\/discoverdevice.com\/cdn\/shop\/products\/1324-GY_Discover.jpg?v=1585128359","\/\/discoverdevice.com\/cdn\/shop\/products\/1324-BK_Discover.jpg?v=1585128360"],"featured_image":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-BKDiscover.jpg?v=1585128476","options":["color"],"media":[{"alt":null,"id":6474276405350,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-BKDiscover.jpg?v=1585128476"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-BKDiscover.jpg?v=1585128476","width":1000},{"alt":null,"id":6474276438118,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-GYDiscover.jpg?v=1585128476"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-GYDiscover.jpg?v=1585128476","width":1000},{"alt":null,"id":6474276470886,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/Discover1_23232db3-7098-4156-81c7-49fe6faf36d6.jpg?v=1585128476"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/Discover1_23232db3-7098-4156-81c7-49fe6faf36d6.jpg?v=1585128476","width":1000},{"alt":null,"id":6474276503654,"position":4,"preview_image":{"aspect_ratio":0.75,"height":784,"width":588,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/Discover.png?v=1585128359"},"aspect_ratio":0.75,"height":784,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/Discover.png?v=1585128359","width":588},{"alt":null,"id":6474277978214,"position":5,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-GY_Discover.jpg?v=1585128359"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-GY_Discover.jpg?v=1585128359","width":1000},{"alt":null,"id":6474278142054,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-BK_Discover.jpg?v=1585128360"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/1324-BK_Discover.jpg?v=1585128360","width":1000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cp\u003eDISCOVER DEVICE® Clip Cord 2.0M 2A\u003c\/p\u003e\n\u003cp\u003eA premium quality and durable cable is a master key to all high quality of tattoo machine,its high conductive brings stable electric to strong power.\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003e\u003cstrong\u003eIts outstanding features\u003c\/strong\u003e\u003cbr\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003e1.apply with high duty of copper wire assures for high conductive.\u003c\/li\u003e\n\u003cli\u003e2.precise complete injection molded of phono jack results in long last,anti-breakage.\u003c\/li\u003e\n\u003cli\u003e3.premium soft pvc cord is good to anti-knots.\u003c\/li\u003e\n\u003cli\u003e4.high durable and save expenses on the tattoo devices.\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cstrong\u003eIts parameter\u003c\/strong\u003e\u003cbr\u003e\n\u003cul\u003e\n\u003cli\u003e1.jack plug crafted from injection molded.\u003c\/li\u003e\n\u003cli\u003e2.length of cable:2m\u003c\/li\u003e\n\u003cli\u003e3.electric conduction:3A.\u003c\/li\u003e\n\u003cli\u003e4.net weight:70grams.\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eFor more details on offer and OEM services please drop message to us as soon as possible.\u003c\/p\u003e\n\u003cp\u003e\u003cbr\u003eThank you from the premium team\u003cbr\u003e\u003c\/p\u003e"}; selectCallback = function(variant, selector) { if (variant) { if (variant.available) { if (variant.compare_at_price > variant.price) { $(".price-box .price").html('' + Shopify.formatMoney(variant.compare_at_price, money_format) + "" + ' ' + Shopify.formatMoney(variant.price, money_format) + "") } else { $(".price-box .price").html('' + Shopify.formatMoney(variant.price, money_format) + ""); } woodmart_settings.enableCurrency && currenciesCallbackSpecial(".price-box span.money"),$(".single_add_to_cart_button").removeClass("disabled").removeAttr("disabled").html(window.inventory_text.add_to_cart); }else{ $("#product-form-quick-4686409367654 .single_add_to_cart_button").html(window.inventory_text.sold_out).addClass("disabled").attr("disabled", "disabled"); } if(swatch_color_type == '1' || swatch_color_type == '2'){ var form = $('#' + selector.domIdPrefix).closest('form'); for (var i=0,length=variant.options.length; i= 1) { //multiple variants for (var i = 0; i < product.variants.length; i++) { var variant = product.variants[i]; var option = ''; layout.find('form.product-form > select').append(option); } new Shopify.OptionSelectors("product-selectors-4686409367654", { product: product, onVariantSelected: selectCallback, enableHistoryState: true }); var filePath = asset_url.substring(0, asset_url.lastIndexOf('/')); var assetUrl = asset_url.substring(0, asset_url.lastIndexOf('/')); var options = ""; for (var i = 0; i < product.options.length; i++) { options += '
'; options += '
' + product.options[i] + ':
'; options += '
'; var is_color = false; var is_circle = 'circle'; if (/Color|Colour/i.test(product.options[i])) { is_color = true; } if (swatch_color_type == '2') { is_color = false; is_circle = ''; } var optionValues = new Array(); for (var j = 0; j < product.variants.length; j++) { var variant = product.variants[j]; var value = variant.options[i]; if(variant.featured_image && woodmart_settings.product_data.product_swatch_setting == '2'){ var img = variant.featured_image.src.lastIndexOf("."); var vimg = variant.featured_image.src.slice(0, img) + "_50x50_crop_center" + variant.featured_image.src.slice(img); } var valueHandle = convertToSlug(value); var forText = 'swatch-4686409367654-' + i + '-' + valueHandle; if (optionValues.indexOf(value) < 0) { options += '
'; if (is_color) { options += '
' + value + '
'; } options += ''; if (is_color) { if(vimg && woodmart_settings.product_data.product_swatch_setting == '2'){ options += ''; }else{ options += ''; } } else { options += ''; } options += '
'; if (variant.available) { $('#product-form-quick-4686409367654 .swatch[data-option-index="' + i + '"] .' + valueHandle).removeClass('soldout').addClass('available').find(':radio').removeAttr('disabled'); } optionValues.push(value); } } options += '
'; options += '
'; } if(swatch_color_type == '1' || swatch_color_type == '2'){ layout.find('form.product-form .product-options > select').after(options); layout.find('.swatch :radio').change(function() { var optionIndex = $(this).closest('.swatch').attr('data-option-index'); var optionValue = $(this).val(); $(this) .closest('form') .find('.single-option-selector') .eq(optionIndex) .val(optionValue) .trigger('change'); }); } if (product.available) { Shopify.quickshopOptionsMap4686409367654 = {}; Shopify.quickshopLinkOptionSelectors4686409367654(product); } } else { //single variant layout.find('form.product-form .product-options > select').remove(); var variant_field = ''; layout.find('form.product-form').append(variant_field); } });