Shopify.quickshopOptionsMap7459918250157 = {}; Shopify.quickshopUpdateOptionsInSelector7459918250157 = function(selectorIndex) { switch (selectorIndex) { case 0: var key = 'root'; var selector = jQuery('#product-form-quick-7459918250157 .single-option-selector:eq(0)'); break; case 1: var key = jQuery('#product-form-quick-7459918250157 .single-option-selector:eq(0)').val(); var selector = jQuery('#product-form-quick-7459918250157 .single-option-selector:eq(1)'); break; case 2: var key = jQuery('#product-form-quick-7459918250157 .single-option-selector:eq(0)').val(); key += ' / ' + jQuery('#product-form-quick-7459918250157 .single-option-selector:eq(1)').val(); var selector = jQuery('#product-form-quick-7459918250157 .single-option-selector:eq(2)'); } var initialValue = selector.val(); selector.empty(); var availableOptions = Shopify.quickshopOptionsMap7459918250157[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-7459918250157 .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.quickshopLinkOptionSelectors7459918250157 = 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.quickshopOptionsMap7459918250157['root'] = Shopify.quickshopOptionsMap7459918250157['root'] || []; Shopify.quickshopOptionsMap7459918250157['root'].push(variant.option1); Shopify.quickshopOptionsMap7459918250157['root'] = Shopify.uniq(Shopify.quickshopOptionsMap7459918250157['root']); // Gathering values for the 2nd drop-down. if (product.options.length > 1) { var key = variant.option1; Shopify.quickshopOptionsMap7459918250157[key] = Shopify.quickshopOptionsMap7459918250157[key] || []; Shopify.quickshopOptionsMap7459918250157[key].push(variant.option2); Shopify.quickshopOptionsMap7459918250157[key] = Shopify.uniq(Shopify.quickshopOptionsMap7459918250157[key]); } // Gathering values for the 3rd drop-down. if (product.options.length === 3) { var key = variant.option1 + ' / ' + variant.option2; Shopify.quickshopOptionsMap7459918250157[key] = Shopify.quickshopOptionsMap7459918250157[key] || []; Shopify.quickshopOptionsMap7459918250157[key].push(variant.option3); Shopify.quickshopOptionsMap7459918250157[key] = Shopify.uniq(Shopify.quickshopOptionsMap7459918250157[key]); } //} } // Update options right away. Shopify.quickshopUpdateOptionsInSelector7459918250157(0); if (product.options.length > 1) Shopify.quickshopUpdateOptionsInSelector7459918250157(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7459918250157(2); // When there is an update in the first dropdown. jQuery("#product-form-quick-7459918250157 .single-option-selector:eq(0)").change(function() { Shopify.quickshopUpdateOptionsInSelector7459918250157(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7459918250157(2); return true; }); // When there is an update in the second dropdown. jQuery("#product-form-quick-7459918250157 .single-option-selector:eq(1)").change(function() { if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7459918250157(2); return true; }); }; productsObj.id7459918250157 = {"id":7459918250157,"title":"Ink Mini Vortex Mixer 10000RPM Built-in Rechargeable Battery","handle":"ink-mini-vortex-mixer-10000rpm-built-in-rechargeable-battery","description":"\u003cp data-mce-fragment=\"1\"\u003e\u003cstrong data-mce-fragment=\"1\"\u003eInk Mini Vortex Mixer 10000RPM Lab Mixer Built-in Rechargeable Battery,Paint Mixer for Ink,Tattoo Accessories Supplies\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eSpeed:10000Rpm\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eMaterial:ABS\u003c\/p\u003e\n\u003cp data-spm-anchor-id=\"a2g0o.detail.1000023.i1.41abuSbluSblnM\" data-mce-fragment=\"1\"\u003eColor:Black,Green,White\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eBattery capacity:1500mAh\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eOperation time:300min\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eWeight:340\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eCharging interface:Type-C\u003c\/p\u003e\n\u003cp data-spm-anchor-id=\"a2g0o.detail.1000023.i0.41abuSbluSblnM\" data-mce-fragment=\"1\"\u003eDimension:13*13*7cm\u003c\/p\u003e","published_at":"2023-12-18T17:18:19+08:00","created_at":"2023-12-18T17:18:19+08:00","vendor":"Discover Device","type":"Tattoo Accessories","tags":[],"price":2995,"price_min":2995,"price_max":3595,"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":42592765739181,"title":"Black-Rechargeable-Wireless","option1":"Black-Rechargeable-Wireless","option2":null,"option3":null,"sku":"VMW-BK","requires_shipping":true,"taxable":false,"featured_image":null,"available":true,"name":"Ink Mini Vortex Mixer 10000RPM Built-in Rechargeable Battery - Black-Rechargeable-Wireless","public_title":"Black-Rechargeable-Wireless","options":["Black-Rechargeable-Wireless"],"price":3595,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"768172202584","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":42592765771949,"title":"White-Rechargeable-Wireless","option1":"White-Rechargeable-Wireless","option2":null,"option3":null,"sku":"VMW-WH","requires_shipping":true,"taxable":false,"featured_image":null,"available":true,"name":"Ink Mini Vortex Mixer 10000RPM Built-in Rechargeable Battery - White-Rechargeable-Wireless","public_title":"White-Rechargeable-Wireless","options":["White-Rechargeable-Wireless"],"price":3595,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"768172202591","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":42592765804717,"title":"Green-Rechargeable-Wireless","option1":"Green-Rechargeable-Wireless","option2":null,"option3":null,"sku":"VMW-GR","requires_shipping":true,"taxable":false,"featured_image":null,"available":true,"name":"Ink Mini Vortex Mixer 10000RPM Built-in Rechargeable Battery - Green-Rechargeable-Wireless","public_title":"Green-Rechargeable-Wireless","options":["Green-Rechargeable-Wireless"],"price":3595,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"768172202607","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":42592765837485,"title":"Black-Wired version","option1":"Black-Wired version","option2":null,"option3":null,"sku":"VM-BK","requires_shipping":true,"taxable":false,"featured_image":null,"available":true,"name":"Ink Mini Vortex Mixer 10000RPM Built-in Rechargeable Battery - Black-Wired version","public_title":"Black-Wired version","options":["Black-Wired version"],"price":2995,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"768172202614","requires_selling_plan":false,"selling_plan_allocations":[]},{"id":42592765870253,"title":"White-Wired version","option1":"White-Wired version","option2":null,"option3":null,"sku":"VM-WH","requires_shipping":true,"taxable":false,"featured_image":null,"available":true,"name":"Ink Mini Vortex Mixer 10000RPM Built-in Rechargeable Battery - White-Wired version","public_title":"White-Wired version","options":["White-Wired version"],"price":2995,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"768172202621","requires_selling_plan":false,"selling_plan_allocations":[]}],"images":["\/\/discoverdevice.com\/cdn\/shop\/files\/3_32fa9a1b-6330-4c8a-ab79-9af87f429ff2.jpg?v=1702891149","\/\/discoverdevice.com\/cdn\/shop\/files\/2_674a79ba-f5cd-496b-9a47-5ad5295d3bae.jpg?v=1702891153","\/\/discoverdevice.com\/cdn\/shop\/files\/5_a5dc6f65-e001-44a9-9f95-236ff6db5e11.jpg?v=1702891134","\/\/discoverdevice.com\/cdn\/shop\/files\/10baa3df5e98dbd938e47f65dd5a91e9.jpg?v=1702891150","\/\/discoverdevice.com\/cdn\/shop\/files\/6_2f293d1a-11cb-48f7-b857-0caa65827b69.jpg?v=1702891126","\/\/discoverdevice.com\/cdn\/shop\/files\/7_565e02c5-ac98-4d44-8615-650a19cefaa5.jpg?v=1702891119"],"featured_image":"\/\/discoverdevice.com\/cdn\/shop\/files\/3_32fa9a1b-6330-4c8a-ab79-9af87f429ff2.jpg?v=1702891149","options":["Color"],"media":[{"alt":null,"id":25959385137325,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/3_32fa9a1b-6330-4c8a-ab79-9af87f429ff2.jpg?v=1702891149"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/3_32fa9a1b-6330-4c8a-ab79-9af87f429ff2.jpg?v=1702891149","width":1600},{"alt":null,"id":25959385170093,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2_674a79ba-f5cd-496b-9a47-5ad5295d3bae.jpg?v=1702891153"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2_674a79ba-f5cd-496b-9a47-5ad5295d3bae.jpg?v=1702891153","width":1600},{"alt":null,"id":25959385202861,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/5_a5dc6f65-e001-44a9-9f95-236ff6db5e11.jpg?v=1702891134"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/5_a5dc6f65-e001-44a9-9f95-236ff6db5e11.jpg?v=1702891134","width":1600},{"alt":null,"id":25959385235629,"position":4,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/10baa3df5e98dbd938e47f65dd5a91e9.jpg?v=1702891150"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/10baa3df5e98dbd938e47f65dd5a91e9.jpg?v=1702891150","width":1600},{"alt":null,"id":25959385301165,"position":5,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/6_2f293d1a-11cb-48f7-b857-0caa65827b69.jpg?v=1702891126"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/6_2f293d1a-11cb-48f7-b857-0caa65827b69.jpg?v=1702891126","width":1600},{"alt":null,"id":25959385333933,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/7_565e02c5-ac98-4d44-8615-650a19cefaa5.jpg?v=1702891119"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/7_565e02c5-ac98-4d44-8615-650a19cefaa5.jpg?v=1702891119","width":1600}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cp data-mce-fragment=\"1\"\u003e\u003cstrong data-mce-fragment=\"1\"\u003eInk Mini Vortex Mixer 10000RPM Lab Mixer Built-in Rechargeable Battery,Paint Mixer for Ink,Tattoo Accessories Supplies\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eSpeed:10000Rpm\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eMaterial:ABS\u003c\/p\u003e\n\u003cp data-spm-anchor-id=\"a2g0o.detail.1000023.i1.41abuSbluSblnM\" data-mce-fragment=\"1\"\u003eColor:Black,Green,White\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eBattery capacity:1500mAh\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eOperation time:300min\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eWeight:340\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eCharging interface:Type-C\u003c\/p\u003e\n\u003cp data-spm-anchor-id=\"a2g0o.detail.1000023.i0.41abuSbluSblnM\" data-mce-fragment=\"1\"\u003eDimension:13*13*7cm\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-7459918250157 .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-7459918250157", { 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-7459918250157-' + 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-7459918250157 .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.quickshopOptionsMap7459918250157 = {}; Shopify.quickshopLinkOptionSelectors7459918250157(product); } } else { //single variant layout.find('form.product-form .product-options > select').remove(); var variant_field = ''; layout.find('form.product-form').append(variant_field); } });