Shopify.quickshopOptionsMap7445864546477 = {}; Shopify.quickshopUpdateOptionsInSelector7445864546477 = function(selectorIndex) { switch (selectorIndex) { case 0: var key = 'root'; var selector = jQuery('#product-form-quick-7445864546477 .single-option-selector:eq(0)'); break; case 1: var key = jQuery('#product-form-quick-7445864546477 .single-option-selector:eq(0)').val(); var selector = jQuery('#product-form-quick-7445864546477 .single-option-selector:eq(1)'); break; case 2: var key = jQuery('#product-form-quick-7445864546477 .single-option-selector:eq(0)').val(); key += ' / ' + jQuery('#product-form-quick-7445864546477 .single-option-selector:eq(1)').val(); var selector = jQuery('#product-form-quick-7445864546477 .single-option-selector:eq(2)'); } var initialValue = selector.val(); selector.empty(); var availableOptions = Shopify.quickshopOptionsMap7445864546477[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-7445864546477 .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.quickshopLinkOptionSelectors7445864546477 = 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.quickshopOptionsMap7445864546477['root'] = Shopify.quickshopOptionsMap7445864546477['root'] || []; Shopify.quickshopOptionsMap7445864546477['root'].push(variant.option1); Shopify.quickshopOptionsMap7445864546477['root'] = Shopify.uniq(Shopify.quickshopOptionsMap7445864546477['root']); // Gathering values for the 2nd drop-down. if (product.options.length > 1) { var key = variant.option1; Shopify.quickshopOptionsMap7445864546477[key] = Shopify.quickshopOptionsMap7445864546477[key] || []; Shopify.quickshopOptionsMap7445864546477[key].push(variant.option2); Shopify.quickshopOptionsMap7445864546477[key] = Shopify.uniq(Shopify.quickshopOptionsMap7445864546477[key]); } // Gathering values for the 3rd drop-down. if (product.options.length === 3) { var key = variant.option1 + ' / ' + variant.option2; Shopify.quickshopOptionsMap7445864546477[key] = Shopify.quickshopOptionsMap7445864546477[key] || []; Shopify.quickshopOptionsMap7445864546477[key].push(variant.option3); Shopify.quickshopOptionsMap7445864546477[key] = Shopify.uniq(Shopify.quickshopOptionsMap7445864546477[key]); } //} } // Update options right away. Shopify.quickshopUpdateOptionsInSelector7445864546477(0); if (product.options.length > 1) Shopify.quickshopUpdateOptionsInSelector7445864546477(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7445864546477(2); // When there is an update in the first dropdown. jQuery("#product-form-quick-7445864546477 .single-option-selector:eq(0)").change(function() { Shopify.quickshopUpdateOptionsInSelector7445864546477(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7445864546477(2); return true; }); // When there is an update in the second dropdown. jQuery("#product-form-quick-7445864546477 .single-option-selector:eq(1)").change(function() { if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7445864546477(2); return true; }); }; productsObj.id7445864546477 = {"id":7445864546477,"title":"DISCOVER DEVICE 1004 Wireless Tattoo Battery","handle":"discover-device-1004-wireless-tattoo-machine","description":"\u003cp\u003e\u003cstrong\u003eDISCOVER DEVICE WIRELESS TATTOO BATTERY 1004\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eProduct Feature:\u003c\/strong\u003e\u003cbr\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eTiming function\u003c\/li\u003e\n\u003cli\u003eJump start function\u003c\/li\u003e\n\u003cli\u003eLarge capacity\u003c\/li\u003e\n\u003cli\u003eSide power button\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eWeight:68g\u003c\/p\u003e\n\u003cp\u003eDiameter:32mm\u003c\/p\u003e\n\u003cp\u003eLenght:50mm\u003c\/p\u003e\n\u003cp\u003eBattery Capacity:1600mAh\u003c\/p\u003e\n\u003cp\u003eWorking Vlotage:4-12V\u003c\/p\u003e\n\u003cp\u003eWorking Mode:Jumpstart\/Standard\u003c\/p\u003e","published_at":"2023-11-22T15:08:04+08:00","created_at":"2023-11-22T15:08:04+08:00","vendor":"Discover Device","type":"Tattoo Battery","tags":[],"price":3595,"price_min":3595,"price_max":6795,"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":42536881848493,"title":"1PCS","option1":"1PCS","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":33493490729133,"product_id":7445864546477,"position":7,"created_at":"2023-11-22T15:09:13+08:00","updated_at":"2023-11-22T15:10:39+08:00","alt":null,"width":1600,"height":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2f577c4a8be33afcb003d3c7d9ab3a61_3199c0b8-7ef1-43de-b3b2-8e2bd2a2d579.jpg?v=1700637039","variant_ids":[42536881848493]},"available":true,"name":"DISCOVER DEVICE 1004 Wireless Tattoo Battery - 1PCS","public_title":"1PCS","options":["1PCS"],"price":3595,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":25837325713581,"position":7,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2f577c4a8be33afcb003d3c7d9ab3a61_3199c0b8-7ef1-43de-b3b2-8e2bd2a2d579.jpg?v=1700637039"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":42536881881261,"title":"2PCS","option1":"2PCS","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":33493485617325,"product_id":7445864546477,"position":1,"created_at":"2023-11-22T15:08:04+08:00","updated_at":"2023-11-22T15:09:09+08:00","alt":null,"width":1600,"height":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/f3380c78b328bcd5df368b040ab3e70d_6d4c6d68-988a-4a8e-a250-f652e6fc6f79.jpg?v=1700636949","variant_ids":[42536881881261]},"available":true,"name":"DISCOVER DEVICE 1004 Wireless Tattoo Battery - 2PCS","public_title":"2PCS","options":["2PCS"],"price":6795,"weight":0,"compare_at_price":null,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":25837320601773,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/f3380c78b328bcd5df368b040ab3e70d_6d4c6d68-988a-4a8e-a250-f652e6fc6f79.jpg?v=1700636949"}},"requires_selling_plan":false,"selling_plan_allocations":[]}],"images":["\/\/discoverdevice.com\/cdn\/shop\/files\/f3380c78b328bcd5df368b040ab3e70d_6d4c6d68-988a-4a8e-a250-f652e6fc6f79.jpg?v=1700636949","\/\/discoverdevice.com\/cdn\/shop\/files\/2_05a1e633-4e91-4206-8cc4-974a11bade46.jpg?v=1700636948","\/\/discoverdevice.com\/cdn\/shop\/files\/3_225521fb-d9f1-4ed1-ab08-073f0c2eec2a.jpg?v=1700636925","\/\/discoverdevice.com\/cdn\/shop\/files\/4_9cdaa180-a869-4a96-a9c9-7b33092106cc.jpg?v=1700636919","\/\/discoverdevice.com\/cdn\/shop\/files\/5_0f575c65-f7f9-4acb-9407-47664776b7e4.jpg?v=1700636937","\/\/discoverdevice.com\/cdn\/shop\/files\/6_f2d3db8b-8fed-4f42-9b6d-4fe87a83406d.jpg?v=1700636932","\/\/discoverdevice.com\/cdn\/shop\/files\/2f577c4a8be33afcb003d3c7d9ab3a61_3199c0b8-7ef1-43de-b3b2-8e2bd2a2d579.jpg?v=1700637039"],"featured_image":"\/\/discoverdevice.com\/cdn\/shop\/files\/f3380c78b328bcd5df368b040ab3e70d_6d4c6d68-988a-4a8e-a250-f652e6fc6f79.jpg?v=1700636949","options":["Style"],"media":[{"alt":null,"id":25837320601773,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/f3380c78b328bcd5df368b040ab3e70d_6d4c6d68-988a-4a8e-a250-f652e6fc6f79.jpg?v=1700636949"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/f3380c78b328bcd5df368b040ab3e70d_6d4c6d68-988a-4a8e-a250-f652e6fc6f79.jpg?v=1700636949","width":1600},{"alt":null,"id":25837320634541,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2_05a1e633-4e91-4206-8cc4-974a11bade46.jpg?v=1700636948"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2_05a1e633-4e91-4206-8cc4-974a11bade46.jpg?v=1700636948","width":1600},{"alt":null,"id":25837320667309,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/3_225521fb-d9f1-4ed1-ab08-073f0c2eec2a.jpg?v=1700636925"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/3_225521fb-d9f1-4ed1-ab08-073f0c2eec2a.jpg?v=1700636925","width":1600},{"alt":null,"id":25837320700077,"position":4,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/4_9cdaa180-a869-4a96-a9c9-7b33092106cc.jpg?v=1700636919"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/4_9cdaa180-a869-4a96-a9c9-7b33092106cc.jpg?v=1700636919","width":1600},{"alt":null,"id":25837320732845,"position":5,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/5_0f575c65-f7f9-4acb-9407-47664776b7e4.jpg?v=1700636937"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/5_0f575c65-f7f9-4acb-9407-47664776b7e4.jpg?v=1700636937","width":1600},{"alt":null,"id":25837320765613,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/6_f2d3db8b-8fed-4f42-9b6d-4fe87a83406d.jpg?v=1700636932"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/6_f2d3db8b-8fed-4f42-9b6d-4fe87a83406d.jpg?v=1700636932","width":1600},{"alt":null,"id":25837325713581,"position":7,"preview_image":{"aspect_ratio":1.0,"height":1600,"width":1600,"src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2f577c4a8be33afcb003d3c7d9ab3a61_3199c0b8-7ef1-43de-b3b2-8e2bd2a2d579.jpg?v=1700637039"},"aspect_ratio":1.0,"height":1600,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/files\/2f577c4a8be33afcb003d3c7d9ab3a61_3199c0b8-7ef1-43de-b3b2-8e2bd2a2d579.jpg?v=1700637039","width":1600}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cp\u003e\u003cstrong\u003eDISCOVER DEVICE WIRELESS TATTOO BATTERY 1004\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cstrong\u003eProduct Feature:\u003c\/strong\u003e\u003cbr\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eTiming function\u003c\/li\u003e\n\u003cli\u003eJump start function\u003c\/li\u003e\n\u003cli\u003eLarge capacity\u003c\/li\u003e\n\u003cli\u003eSide power button\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003eWeight:68g\u003c\/p\u003e\n\u003cp\u003eDiameter:32mm\u003c\/p\u003e\n\u003cp\u003eLenght:50mm\u003c\/p\u003e\n\u003cp\u003eBattery Capacity:1600mAh\u003c\/p\u003e\n\u003cp\u003eWorking Vlotage:4-12V\u003c\/p\u003e\n\u003cp\u003eWorking Mode:Jumpstart\/Standard\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-7445864546477 .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-7445864546477", { 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-7445864546477-' + 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-7445864546477 .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.quickshopOptionsMap7445864546477 = {}; Shopify.quickshopLinkOptionSelectors7445864546477(product); } } else { //single variant layout.find('form.product-form .product-options > select').remove(); var variant_field = ''; layout.find('form.product-form').append(variant_field); } });