Shopify.quickshopOptionsMap7080150073517 = {}; Shopify.quickshopUpdateOptionsInSelector7080150073517 = function(selectorIndex) { switch (selectorIndex) { case 0: var key = 'root'; var selector = jQuery('#product-form-quick-7080150073517 .single-option-selector:eq(0)'); break; case 1: var key = jQuery('#product-form-quick-7080150073517 .single-option-selector:eq(0)').val(); var selector = jQuery('#product-form-quick-7080150073517 .single-option-selector:eq(1)'); break; case 2: var key = jQuery('#product-form-quick-7080150073517 .single-option-selector:eq(0)').val(); key += ' / ' + jQuery('#product-form-quick-7080150073517 .single-option-selector:eq(1)').val(); var selector = jQuery('#product-form-quick-7080150073517 .single-option-selector:eq(2)'); } var initialValue = selector.val(); selector.empty(); var availableOptions = Shopify.quickshopOptionsMap7080150073517[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-7080150073517 .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.quickshopLinkOptionSelectors7080150073517 = 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.quickshopOptionsMap7080150073517['root'] = Shopify.quickshopOptionsMap7080150073517['root'] || []; Shopify.quickshopOptionsMap7080150073517['root'].push(variant.option1); Shopify.quickshopOptionsMap7080150073517['root'] = Shopify.uniq(Shopify.quickshopOptionsMap7080150073517['root']); // Gathering values for the 2nd drop-down. if (product.options.length > 1) { var key = variant.option1; Shopify.quickshopOptionsMap7080150073517[key] = Shopify.quickshopOptionsMap7080150073517[key] || []; Shopify.quickshopOptionsMap7080150073517[key].push(variant.option2); Shopify.quickshopOptionsMap7080150073517[key] = Shopify.uniq(Shopify.quickshopOptionsMap7080150073517[key]); } // Gathering values for the 3rd drop-down. if (product.options.length === 3) { var key = variant.option1 + ' / ' + variant.option2; Shopify.quickshopOptionsMap7080150073517[key] = Shopify.quickshopOptionsMap7080150073517[key] || []; Shopify.quickshopOptionsMap7080150073517[key].push(variant.option3); Shopify.quickshopOptionsMap7080150073517[key] = Shopify.uniq(Shopify.quickshopOptionsMap7080150073517[key]); } //} } // Update options right away. Shopify.quickshopUpdateOptionsInSelector7080150073517(0); if (product.options.length > 1) Shopify.quickshopUpdateOptionsInSelector7080150073517(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7080150073517(2); // When there is an update in the first dropdown. jQuery("#product-form-quick-7080150073517 .single-option-selector:eq(0)").change(function() { Shopify.quickshopUpdateOptionsInSelector7080150073517(1); if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7080150073517(2); return true; }); // When there is an update in the second dropdown. jQuery("#product-form-quick-7080150073517 .single-option-selector:eq(1)").change(function() { if (product.options.length === 3) Shopify.quickshopUpdateOptionsInSelector7080150073517(2); return true; }); }; productsObj.id7080150073517 = {"id":7080150073517,"title":"Discover Device Gift Card","handle":"discover-device-gift-card","description":"\u003cspan class=\"VIiyi\" data-mce-fragment=\"1\" jsaction=\"mouseup:BR6jm\" jsname=\"jqKxS\" lang=\"en\"\u003e\u003cspan class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"en\" data-language-to-translate-into=\"zh-CN\" data-phrase-index=\"0\" data-number-of-phrases=\"1\" data-mce-fragment=\"1\" jsaction=\"agoMJf:PFBcW;usxOmf:aWLT7;jhKsnd:P7O7bd,F8DmGf;Q4AGo:Gm7gYd,qAKMYb;uFUCPb:pvnm0e,pfE8Hb,PFBcW;f56efd:dJXsye;EnoYf:KNzws,ZJsZZ,JgVSJc;zdMJQc:cCQNKb,ZJsZZ,zchEXc;Ytrrj:JJDvdc;tNR8yc:GeFvjb;oFN6Ye:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" jscontroller=\"Zl5N8\" jsdata=\"uqLsIf;_;$945\" jsmodel=\"SsMkhd\"\u003e\u003cspan data-mce-fragment=\"1\" jsaction=\"click:qtZ4nf,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:qtZ4nf,c2aHje\" jsname=\"W297wb\"\u003e\u003c\/span\u003e\u003c\/span\u003e\u003c\/span\u003e\u003cspan class=\"VIiyi\" data-mce-fragment=\"1\" jsaction=\"mouseup:BR6jm\" jsname=\"jqKxS\" lang=\"en\"\u003e\u003cspan class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"en\" data-language-to-translate-into=\"zh-CN\" data-phrase-index=\"0\" data-number-of-phrases=\"1\" data-mce-fragment=\"1\" jsaction=\"agoMJf:PFBcW;usxOmf:aWLT7;jhKsnd:P7O7bd,F8DmGf;Q4AGo:Gm7gYd,qAKMYb;uFUCPb:pvnm0e,pfE8Hb,PFBcW;f56efd:dJXsye;EnoYf:KNzws,ZJsZZ,JgVSJc;zdMJQc:cCQNKb,ZJsZZ,zchEXc;Ytrrj:JJDvdc;tNR8yc:GeFvjb;oFN6Ye:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" jscontroller=\"Zl5N8\" jsdata=\"uqLsIf;_;$1042\" jsmodel=\"SsMkhd\"\u003e\u003cspan data-mce-fragment=\"1\" jsaction=\"click:qtZ4nf,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:qtZ4nf,c2aHje\" jsname=\"W297wb\"\u003eThe denomination of the gift card can be used to deduct the order amount\u003c\/span\u003e\u003c\/span\u003e\u003c\/span\u003e.","published_at":"2021-12-18T11:06:43+08:00","created_at":"2021-12-14T11:59:46+08:00","vendor":"Discover Device","type":"礼品卡","tags":[],"price":1124,"price_min":1124,"price_max":12644,"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":41179438907565,"title":"US$10.00","option1":"US$10.00","option2":null,"option3":null,"sku":"card-10","requires_shipping":false,"taxable":false,"featured_image":{"id":31180266340525,"product_id":7080150073517,"position":1,"created_at":"2021-12-18T11:00:09+08:00","updated_at":"2021-12-18T11:00:43+08:00","alt":null,"width":604,"height":854,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/10.png?v=1639796443","variant_ids":[41179438907565]},"available":true,"name":"Discover Device Gift Card - US$10.00","public_title":"US$10.00","options":["US$10.00"],"price":1124,"weight":0,"compare_at_price":null,"inventory_management":null,"barcode":null,"featured_media":{"alt":null,"id":23470573977773,"position":1,"preview_image":{"aspect_ratio":0.707,"height":854,"width":604,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/10.png?v=1639796443"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":41179438940333,"title":"US$25.00","option1":"US$25.00","option2":null,"option3":null,"sku":"card-25","requires_shipping":false,"taxable":false,"featured_image":{"id":31180274696365,"product_id":7080150073517,"position":2,"created_at":"2021-12-18T11:01:53+08:00","updated_at":"2021-12-18T11:02:56+08:00","alt":null,"width":604,"height":854,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/25.png?v=1639796576","variant_ids":[41179438940333]},"available":true,"name":"Discover Device Gift Card - US$25.00","public_title":"US$25.00","options":["US$25.00"],"price":3091,"weight":0,"compare_at_price":null,"inventory_management":null,"barcode":null,"featured_media":{"alt":null,"id":23470582366381,"position":2,"preview_image":{"aspect_ratio":0.707,"height":854,"width":604,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/25.png?v=1639796576"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":41179438973101,"title":"US$50.00","option1":"US$50.00","option2":null,"option3":null,"sku":"card-50","requires_shipping":false,"taxable":false,"featured_image":{"id":31180274761901,"product_id":7080150073517,"position":3,"created_at":"2021-12-18T11:01:53+08:00","updated_at":"2021-12-18T11:02:51+08:00","alt":null,"width":604,"height":854,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/50.png?v=1639796571","variant_ids":[41179438973101]},"available":true,"name":"Discover Device Gift Card - US$50.00","public_title":"US$50.00","options":["US$50.00"],"price":5901,"weight":0,"compare_at_price":null,"inventory_management":null,"barcode":null,"featured_media":{"alt":null,"id":23470582399149,"position":3,"preview_image":{"aspect_ratio":0.707,"height":854,"width":604,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/50.png?v=1639796571"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":41179439005869,"title":"US$100.00","option1":"US$100.00","option2":null,"option3":null,"sku":"card-100","requires_shipping":false,"taxable":false,"featured_image":{"id":31180274729133,"product_id":7080150073517,"position":4,"created_at":"2021-12-18T11:01:53+08:00","updated_at":"2021-12-18T11:02:43+08:00","alt":null,"width":604,"height":854,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/100.png?v=1639796563","variant_ids":[41179439005869]},"available":true,"name":"Discover Device Gift Card - US$100.00","public_title":"US$100.00","options":["US$100.00"],"price":12644,"weight":0,"compare_at_price":null,"inventory_management":null,"barcode":null,"featured_media":{"alt":null,"id":23470582431917,"position":4,"preview_image":{"aspect_ratio":0.707,"height":854,"width":604,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/100.png?v=1639796563"}},"requires_selling_plan":false,"selling_plan_allocations":[]}],"images":["\/\/discoverdevice.com\/cdn\/shop\/products\/10.png?v=1639796443","\/\/discoverdevice.com\/cdn\/shop\/products\/25.png?v=1639796576","\/\/discoverdevice.com\/cdn\/shop\/products\/50.png?v=1639796571","\/\/discoverdevice.com\/cdn\/shop\/products\/100.png?v=1639796563"],"featured_image":"\/\/discoverdevice.com\/cdn\/shop\/products\/10.png?v=1639796443","options":["面额"],"media":[{"alt":null,"id":23470573977773,"position":1,"preview_image":{"aspect_ratio":0.707,"height":854,"width":604,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/10.png?v=1639796443"},"aspect_ratio":0.707,"height":854,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/10.png?v=1639796443","width":604},{"alt":null,"id":23470582366381,"position":2,"preview_image":{"aspect_ratio":0.707,"height":854,"width":604,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/25.png?v=1639796576"},"aspect_ratio":0.707,"height":854,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/25.png?v=1639796576","width":604},{"alt":null,"id":23470582399149,"position":3,"preview_image":{"aspect_ratio":0.707,"height":854,"width":604,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/50.png?v=1639796571"},"aspect_ratio":0.707,"height":854,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/50.png?v=1639796571","width":604},{"alt":null,"id":23470582431917,"position":4,"preview_image":{"aspect_ratio":0.707,"height":854,"width":604,"src":"\/\/discoverdevice.com\/cdn\/shop\/products\/100.png?v=1639796563"},"aspect_ratio":0.707,"height":854,"media_type":"image","src":"\/\/discoverdevice.com\/cdn\/shop\/products\/100.png?v=1639796563","width":604}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cspan class=\"VIiyi\" data-mce-fragment=\"1\" jsaction=\"mouseup:BR6jm\" jsname=\"jqKxS\" lang=\"en\"\u003e\u003cspan class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"en\" data-language-to-translate-into=\"zh-CN\" data-phrase-index=\"0\" data-number-of-phrases=\"1\" data-mce-fragment=\"1\" jsaction=\"agoMJf:PFBcW;usxOmf:aWLT7;jhKsnd:P7O7bd,F8DmGf;Q4AGo:Gm7gYd,qAKMYb;uFUCPb:pvnm0e,pfE8Hb,PFBcW;f56efd:dJXsye;EnoYf:KNzws,ZJsZZ,JgVSJc;zdMJQc:cCQNKb,ZJsZZ,zchEXc;Ytrrj:JJDvdc;tNR8yc:GeFvjb;oFN6Ye:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" jscontroller=\"Zl5N8\" jsdata=\"uqLsIf;_;$945\" jsmodel=\"SsMkhd\"\u003e\u003cspan data-mce-fragment=\"1\" jsaction=\"click:qtZ4nf,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:qtZ4nf,c2aHje\" jsname=\"W297wb\"\u003e\u003c\/span\u003e\u003c\/span\u003e\u003c\/span\u003e\u003cspan class=\"VIiyi\" data-mce-fragment=\"1\" jsaction=\"mouseup:BR6jm\" jsname=\"jqKxS\" lang=\"en\"\u003e\u003cspan class=\"JLqJ4b ChMk0b\" data-language-for-alternatives=\"en\" data-language-to-translate-into=\"zh-CN\" data-phrase-index=\"0\" data-number-of-phrases=\"1\" data-mce-fragment=\"1\" jsaction=\"agoMJf:PFBcW;usxOmf:aWLT7;jhKsnd:P7O7bd,F8DmGf;Q4AGo:Gm7gYd,qAKMYb;uFUCPb:pvnm0e,pfE8Hb,PFBcW;f56efd:dJXsye;EnoYf:KNzws,ZJsZZ,JgVSJc;zdMJQc:cCQNKb,ZJsZZ,zchEXc;Ytrrj:JJDvdc;tNR8yc:GeFvjb;oFN6Ye:hij5Wb;bmeZHc:iURhpf;Oxj3Xe:qAKMYb,yaf12d\" jsname=\"txFAF\" jscontroller=\"Zl5N8\" jsdata=\"uqLsIf;_;$1042\" jsmodel=\"SsMkhd\"\u003e\u003cspan data-mce-fragment=\"1\" jsaction=\"click:qtZ4nf,GFf3ac,tMZCfe; contextmenu:Nqw7Te,QP7LD; mouseout:Nqw7Te; mouseover:qtZ4nf,c2aHje\" jsname=\"W297wb\"\u003eThe denomination of the gift card can be used to deduct the order amount\u003c\/span\u003e\u003c\/span\u003e\u003c\/span\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-7080150073517 .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-7080150073517", { 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-7080150073517-' + 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-7080150073517 .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.quickshopOptionsMap7080150073517 = {}; Shopify.quickshopLinkOptionSelectors7080150073517(product); } } else { //single variant layout.find('form.product-form .product-options > select').remove(); var variant_field = ''; layout.find('form.product-form').append(variant_field); } });