Shopify.quickshopOptionsMap8019564855469 = {}; Shopify.quickshopUpdateOptionsInSelector8019564855469 = function(selectorIndex) { switch (selectorIndex) { case 0: var key = 'root'; var selector = jQuery('#product-form-quick-8019564855469 .single-option-selector:eq(0)'); break; case 1: var key = jQuery('#product-form-quick-8019564855469 .single-option-selector:eq(0)').val(); var selector = jQuery('#product-form-quick-8019564855469 .single-option-selector:eq(1)'); break; case 2: var key = jQuery('#product-form-quick-8019564855469 .single-option-selector:eq(0)').val(); key += ' / ' + jQuery('#product-form-quick-8019564855469 .single-option-selector:eq(1)').val(); var selector = jQuery('#product-form-quick-8019564855469 .single-option-selector:eq(2)'); } var initialValue = selector.val(); selector.empty(); var availableOptions = Shopify.quickshopOptionsMap8019564855469[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-8019564855469 .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.quickshopLinkOptionSelectors8019564855469 = 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.quickshopOptionsMap8019564855469['root'] = Shopify.quickshopOptionsMap8019564855469['root'] || []; Shopify.quickshopOptionsMap8019564855469['root'].push(variant.option1); Shopify.quickshopOptionsMap8019564855469['root'] = Shopify.uniq(Shopify.quickshopOptionsMap8019564855469['root']); // Gathering values for the 2nd drop-down. if (product.options.length > 1) { var key = variant.option1; Shopify.quickshopOptionsMap8019564855469[key] = Shopify.quickshopOptionsMap8019564855469[key] || []; Shopify.quickshopOptionsMap8019564855469[key].push(variant.option2); Shopify.quickshopOptionsMap8019564855469[key] = Shopify.uniq(Shopify.quickshopOptionsMap8019564855469[key]); } // Gathering values for the 3rd drop-down. if (product.options.length === 3) { var key = variant.option1 + ' / ' + variant.option2; Shopify.quickshopOptionsMap8019564855469[key] = Shopify.quickshopOptionsMap8019564855469[key] || []; Shopify.quickshopOptionsMap8019564855469[key].push(variant.option3); Shopify.quickshopOptionsMap8019564855469[key] = Shopify.uniq(Shopify.quickshopOptionsMap8019564855469[key]); } //} } // Update options right away. Shopify.quickshopUpdateOptionsInSelector8019564855469(0); if (product.options.length > 1) Shopify.quickshopUpdateOptionsInSelector8019564855469(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector8019564855469(2); // When there is an update in the first dropdown. jQuery("#product-form-quick-8019564855469 .single-option-selector:eq(0)").change(function() { Shopify.quickshopUpdateOptionsInSelector8019564855469(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector8019564855469(2); return true; }); // When there is an update in the second dropdown. jQuery("#product-form-quick-8019564855469 .single-option-selector:eq(1)").change(function() { if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector8019564855469(2); return true; }); }; productsObj.id8019564855469 = {"id":8019564855469,"title":"Silicone Tattoo Ink Caps #16*12 with Base 200pcs Mix Color","handle":"silicone-tattoo-ink-caps-with-base-200pcs-mix-color","description":"\u003cp\u003e\u003cstrong\u003eDiscover Device \u003c\/strong\u003e\u003cstrong\u003eSilicone Tattoo Ink Caps with Base 200pcs Mix Color\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003eMaterial:High quality silicone\u003c\/p\u003e\n\u003cp\u003eSize of Round :1.6cm\/0.63in(Diameter)*2.1cm\/0.82in(Base Diameter)*1.2cm\/0.47in(Height)\u003c\/p\u003e\n\u003cp\u003eSize of Heart:1.9cm\/0.74in(Width)*2.3cm\u003c\/p\u003e\n\u003cp\u003eQTY:200pcs\/bag\u003c\/p\u003e","published_at":"2025-01-17T11:07:06+08:00","created_at":"2025-01-17T11:07:06+08:00","vendor":"Discover Device","type":"Tattoo Accessories","tags":[],"price":1900,"price_min":1900,"price_max":1900,"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":44075741479085,"title":"Round","option1":"Round","option2":null,"option3":null,"sku":"RSC-200","requires_shipping":true,"taxable":false,"featured_image":{"id":36405319598253,"product_id":8019564855469,"position":1,"created_at":"2025-01-18T12:00:22+08:00","updated_at":"2025-02-05T04:01:13+08:00","alt":null,"width":1600,"height":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/47f8c823b4eca9e83aced7a6351a534e.jpg?v=1738699273","variant_ids":[44075741479085]},"available":true,"name":"Silicone Tattoo Ink Caps #16*12 with Base 200pcs Mix Color - Round","public_title":"Round","options":["Round"],"price":1900,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"701555871632","featured_media":{"alt":null,"id":28479263277229,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/47f8c823b4eca9e83aced7a6351a534e.jpg?v=1738699273"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44075741511853,"title":"Heart","option1":"Heart","option2":null,"option3":null,"sku":"HSC-201","requires_shipping":true,"taxable":false,"featured_image":{"id":36405319499949,"product_id":8019564855469,"position":8,"created_at":"2025-01-18T12:00:21+08:00","updated_at":"2025-02-05T04:13:22+08:00","alt":null,"width":1600,"height":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/7ccc729f4ab1502a568b949d066e4320.jpg?v=1738700002","variant_ids":[44075741511853]},"available":true,"name":"Silicone Tattoo Ink Caps #16*12 with Base 200pcs Mix Color - Heart","public_title":"Heart","options":["Heart"],"price":1900,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"701555871649","featured_media":{"alt":null,"id":28479263047853,"position":8,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/7ccc729f4ab1502a568b949d066e4320.jpg?v=1738700002"}},"requires_selling_plan":false,"selling_plan_allocations":[]}],"images":["\/\/discoverdevice.com\/cdn\/shop\/files\/47f8c823b4eca9e83aced7a6351a534e.jpg?v=1738699273","\/\/discoverdevice.com\/cdn\/shop\/files\/2_fc2b7705-b3da-4bf2-b7ce-c0e9a2986475.jpg?v=1738699998","\/\/discoverdevice.com\/cdn\/shop\/files\/1_f94891a9-9d91-453d-870a-5a9962ceac9d.jpg?v=1738700000","\/\/discoverdevice.com\/cdn\/shop\/files\/3_155a0321-241b-434e-8d0e-58da6b31a291.jpg?v=1738699625","\/\/discoverdevice.com\/cdn\/shop\/files\/Silicone-tattoo-cups_47038eae-7175-4186-a3ef-9312d13d71f8.jpg?v=1738700388","\/\/discoverdevice.com\/cdn\/shop\/files\/5_b8fe1ced-7b4b-4adc-b856-3c0fd781faf4.jpg?v=1738699610","\/\/discoverdevice.com\/cdn\/shop\/files\/4_d174ed37-5f93-4929-a13d-604845da563a.jpg?v=1738699622","\/\/discoverdevice.com\/cdn\/shop\/files\/7ccc729f4ab1502a568b949d066e4320.jpg?v=1738700002","\/\/discoverdevice.com\/cdn\/shop\/files\/c2fdde4528e04a28f0a920533c6754e8.jpg?v=1738700383"],"featured_image":"\/\/discoverdevice.com\/cdn\/shop\/files\/47f8c823b4eca9e83aced7a6351a534e.jpg?v=1738699273","options":["Style"],"media":[{"alt":null,"id":28479263277229,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/47f8c823b4eca9e83aced7a6351a534e.jpg?v=1738699273"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/47f8c823b4eca9e83aced7a6351a534e.jpg?v=1738699273","width":1600},{"alt":null,"id":28479263113389,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2_fc2b7705-b3da-4bf2-b7ce-c0e9a2986475.jpg?v=1738699998"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2_fc2b7705-b3da-4bf2-b7ce-c0e9a2986475.jpg?v=1738699998","width":1600},{"alt":null,"id":28479263080621,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/1_f94891a9-9d91-453d-870a-5a9962ceac9d.jpg?v=1738700000"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/1_f94891a9-9d91-453d-870a-5a9962ceac9d.jpg?v=1738700000","width":1600},{"alt":null,"id":28479263178925,"position":4,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/3_155a0321-241b-434e-8d0e-58da6b31a291.jpg?v=1738699625"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/3_155a0321-241b-434e-8d0e-58da6b31a291.jpg?v=1738699625","width":1600},{"alt":null,"id":28479262982317,"position":5,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/Silicone-tattoo-cups_47038eae-7175-4186-a3ef-9312d13d71f8.jpg?v=1738700388"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/Silicone-tattoo-cups_47038eae-7175-4186-a3ef-9312d13d71f8.jpg?v=1738700388","width":1600},{"alt":null,"id":28479263244461,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/5_b8fe1ced-7b4b-4adc-b856-3c0fd781faf4.jpg?v=1738699610"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/5_b8fe1ced-7b4b-4adc-b856-3c0fd781faf4.jpg?v=1738699610","width":1600},{"alt":null,"id":28479263211693,"position":7,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/4_d174ed37-5f93-4929-a13d-604845da563a.jpg?v=1738699622"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/4_d174ed37-5f93-4929-a13d-604845da563a.jpg?v=1738699622","width":1600},{"alt":null,"id":28479263047853,"position":8,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/7ccc729f4ab1502a568b949d066e4320.jpg?v=1738700002"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/7ccc729f4ab1502a568b949d066e4320.jpg?v=1738700002","width":1600},{"alt":null,"id":28479263015085,"position":9,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/c2fdde4528e04a28f0a920533c6754e8.jpg?v=1738700383"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/c2fdde4528e04a28f0a920533c6754e8.jpg?v=1738700383","width":1600}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cp\u003e\u003cstrong\u003eDiscover Device \u003c\/strong\u003e\u003cstrong\u003eSilicone Tattoo Ink Caps with Base 200pcs Mix Color\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003eMaterial:High quality silicone\u003c\/p\u003e\n\u003cp\u003eSize of Round :1.6cm\/0.63in(Diameter)*2.1cm\/0.82in(Base Diameter)*1.2cm\/0.47in(Height)\u003c\/p\u003e\n\u003cp\u003eSize of Heart:1.9cm\/0.74in(Width)*2.3cm\u003c\/p\u003e\n\u003cp\u003eQTY:200pcs\/bag\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-8019564855469 .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-8019564855469", { 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-8019564855469-' + 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-8019564855469 .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.quickshopOptionsMap8019564855469 = {}; Shopify.quickshopLinkOptionSelectors8019564855469(product); } } else { //single variant layout.find('form.product-form .product-options > select').remove(); var variant_field = ''; layout.find('form.product-form').append(variant_field); } });