Shopify.quickshopOptionsMap7286145188013 = {}; Shopify.quickshopUpdateOptionsInSelector7286145188013 = function(selectorIndex) { switch (selectorIndex) { case 0: var key = 'root'; var selector = jQuery('#product-form-quick-7286145188013 .single-option-selector:eq(0)'); break; case 1: var key = jQuery('#product-form-quick-7286145188013 .single-option-selector:eq(0)').val(); var selector = jQuery('#product-form-quick-7286145188013 .single-option-selector:eq(1)'); break; case 2: var key = jQuery('#product-form-quick-7286145188013 .single-option-selector:eq(0)').val(); key += ' / ' + jQuery('#product-form-quick-7286145188013 .single-option-selector:eq(1)').val(); var selector = jQuery('#product-form-quick-7286145188013 .single-option-selector:eq(2)'); } var initialValue = selector.val(); selector.empty(); var availableOptions = Shopify.quickshopOptionsMap7286145188013[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-7286145188013 .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.quickshopLinkOptionSelectors7286145188013 = 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.quickshopOptionsMap7286145188013['root'] = Shopify.quickshopOptionsMap7286145188013['root'] || []; Shopify.quickshopOptionsMap7286145188013['root'].push(variant.option1); Shopify.quickshopOptionsMap7286145188013['root'] = Shopify.uniq(Shopify.quickshopOptionsMap7286145188013['root']); // Gathering values for the 2nd drop-down. if (product.options.length > 1) { var key = variant.option1; Shopify.quickshopOptionsMap7286145188013[key] = Shopify.quickshopOptionsMap7286145188013[key] || []; Shopify.quickshopOptionsMap7286145188013[key].push(variant.option2); Shopify.quickshopOptionsMap7286145188013[key] = Shopify.uniq(Shopify.quickshopOptionsMap7286145188013[key]); } // Gathering values for the 3rd drop-down. if (product.options.length === 3) { var key = variant.option1 + ' / ' + variant.option2; Shopify.quickshopOptionsMap7286145188013[key] = Shopify.quickshopOptionsMap7286145188013[key] || []; Shopify.quickshopOptionsMap7286145188013[key].push(variant.option3); Shopify.quickshopOptionsMap7286145188013[key] = Shopify.uniq(Shopify.quickshopOptionsMap7286145188013[key]); } //} } // Update options right away. Shopify.quickshopUpdateOptionsInSelector7286145188013(0); if (product.options.length > 1) Shopify.quickshopUpdateOptionsInSelector7286145188013(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7286145188013(2); // When there is an update in the first dropdown. jQuery("#product-form-quick-7286145188013 .single-option-selector:eq(0)").change(function() { Shopify.quickshopUpdateOptionsInSelector7286145188013(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7286145188013(2); return true; }); // When there is an update in the second dropdown. jQuery("#product-form-quick-7286145188013 .single-option-selector:eq(1)").change(function() { if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7286145188013(2); return true; }); }; productsObj.id7286145188013 = {"id":7286145188013,"title":"Denergy®-Tattoo Grip Cover Wrap Hot Pink 24pcs\/Box × 2","handle":"denergy®-tattoo-grip-cover-wrap-hot-pink-24pcs-box-2","description":"Specification :\u003cbr data-mce-fragment=\"1\"\u003eColor:Hot Pink\u003cbr data-mce-fragment=\"1\"\u003eMaterial:medical non woven\u003cbr data-mce-fragment=\"1\"\u003eWidth: 5CM\u003cbr data-mce-fragment=\"1\"\u003eLength: 4.5M\u003cbr data-mce-fragment=\"1\"\u003eQuantity: 24pcs\/Box × 2(48pcs)","published_at":"2022-12-01T15:48:15+08:00","created_at":"2022-12-01T15:48:13+08:00","vendor":"Denergy","type":"Tattoo Accessories","tags":[],"price":2600,"price_min":2600,"price_max":7400,"available":true,"price_varies":true,"compare_at_price":null,"compare_at_price_min":0,"compare_at_price_max":0,"compare_at_price_varies":false,"variants":[{"id":42014738645165,"title":"24pcs\/Box × 2","option1":"24pcs\/Box × 2","option2":null,"option3":null,"sku":"2475Pink-24Pcs × 2","requires_shipping":true,"taxable":false,"featured_image":null,"available":true,"name":"Denergy®-Tattoo Grip Cover Wrap Hot Pink 24pcs\/Box × 2 - 24pcs\/Box × 2","public_title":"24pcs\/Box × 2","options":["24pcs\/Box × 2"],"price":4200,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"784633864801","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":42014738677933,"title":"24pcs\/Box × 4","option1":"24pcs\/Box × 4","option2":null,"option3":null,"sku":"2475Pink-24pcs × 4","requires_shipping":true,"taxable":false,"featured_image":null,"available":true,"name":"Denergy®-Tattoo Grip Cover Wrap Hot Pink 24pcs\/Box × 2 - 24pcs\/Box × 4","public_title":"24pcs\/Box × 4","options":["24pcs\/Box × 4"],"price":7400,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"784633864818","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":42014738710701,"title":"24pcs\/Box × 1","option1":"24pcs\/Box × 1","option2":null,"option3":null,"sku":"2475-Pink-24pcs","requires_shipping":true,"taxable":false,"featured_image":null,"available":true,"name":"Denergy®-Tattoo Grip Cover Wrap Hot Pink 24pcs\/Box × 2 - 24pcs\/Box × 1","public_title":"24pcs\/Box × 1","options":["24pcs\/Box × 1"],"price":2600,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"784633864825","requires_selling_plan":false,"selling_plan_allocations":[]}],"images":["\/\/discoverdevice.com\/cdn\/shop\/products\/6PCS.jpg?v=1669880940","\/\/discoverdevice.com\/cdn\/shop\/products\/3_ca4ae357-c247-421c-a0f0-835a43fa76ef.jpg?v=1669880935","\/\/discoverdevice.com\/cdn\/shop\/products\/2_9a8d7df4-674b-4b07-a557-551e4e1336b1.jpg?v=1669881056","\/\/discoverdevice.com\/cdn\/shop\/products\/4_6aeb3b0d-ba46-48a0-b35b-fd8316a7cbbf.jpg?v=1669880929","\/\/discoverdevice.com\/cdn\/shop\/products\/6_366d8187-2157-4e7a-9820-c6c1048ee540.jpg?v=1669880923","\/\/discoverdevice.com\/cdn\/shop\/products\/7_fbce603c-17b3-4c0f-a716-689a3161a50f.jpg?v=1669881049","\/\/discoverdevice.com\/cdn\/shop\/products\/5_e26e51da-81ef-4d2a-8cb8-0086b3b221a3.jpg?v=1669881044"],"featured_image":"\/\/discoverdevice.com\/cdn\/shop\/products\/6PCS.jpg?v=1669880940","options":["Quantity"],"media":[{"alt":null,"id":24906852532397,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/6PCS.jpg?v=1669880940"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/6PCS.jpg?v=1669880940","width":1600},{"alt":null,"id":24906852565165,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/3_ca4ae357-c247-421c-a0f0-835a43fa76ef.jpg?v=1669880935"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/3_ca4ae357-c247-421c-a0f0-835a43fa76ef.jpg?v=1669880935","width":1600},{"alt":null,"id":24906852597933,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/2_9a8d7df4-674b-4b07-a557-551e4e1336b1.jpg?v=1669881056"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/2_9a8d7df4-674b-4b07-a557-551e4e1336b1.jpg?v=1669881056","width":1600},{"alt":null,"id":24906852630701,"position":4,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/4_6aeb3b0d-ba46-48a0-b35b-fd8316a7cbbf.jpg?v=1669880929"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/4_6aeb3b0d-ba46-48a0-b35b-fd8316a7cbbf.jpg?v=1669880929","width":1600},{"alt":null,"id":24906852696237,"position":5,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/6_366d8187-2157-4e7a-9820-c6c1048ee540.jpg?v=1669880923"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/6_366d8187-2157-4e7a-9820-c6c1048ee540.jpg?v=1669880923","width":1600},{"alt":null,"id":24906852729005,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/7_fbce603c-17b3-4c0f-a716-689a3161a50f.jpg?v=1669881049"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/7_fbce603c-17b3-4c0f-a716-689a3161a50f.jpg?v=1669881049","width":1600},{"alt":null,"id":24906852761773,"position":7,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/5_e26e51da-81ef-4d2a-8cb8-0086b3b221a3.jpg?v=1669881044"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/5_e26e51da-81ef-4d2a-8cb8-0086b3b221a3.jpg?v=1669881044","width":1600}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"Specification :\u003cbr data-mce-fragment=\"1\"\u003eColor:Hot Pink\u003cbr data-mce-fragment=\"1\"\u003eMaterial:medical non woven\u003cbr data-mce-fragment=\"1\"\u003eWidth: 5CM\u003cbr data-mce-fragment=\"1\"\u003eLength: 4.5M\u003cbr data-mce-fragment=\"1\"\u003eQuantity: 24pcs\/Box × 2(48pcs)"}; 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-7286145188013 .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-7286145188013", { 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-7286145188013-' + 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-7286145188013 .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.quickshopOptionsMap7286145188013 = {}; Shopify.quickshopLinkOptionSelectors7286145188013(product); } } else { //single variant layout.find('form.product-form .product-options > select').remove(); var variant_field = ''; layout.find('form.product-form').append(variant_field); } });