Shopify.queue = []; $product = {"id":1432684101731,"title":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列","handle":"iphone-8-plus-solidsuit","description":"","published_at":"2018-10-07T00:15:51+08:00","created_at":"2018-09-26T00:21:17+08:00","vendor":"愛進化科技股份有限公司","type":"SolidSuit","tags":["20%","25%","30%","35%","40%","45%","45degree","50%","brand-Apple","device-iPhone 8 Plus","dropdownCollection-SolidSuit","dropdownDevice-Apple iPhone 7 Plus\/8 Plus","iPhone 7 Plus\/8 Plus","iPhone 8 Plus","member","quickbuy","reseller","reseller-asus","Top50"],"price":73000,"price_min":73000,"price_max":98000,"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":12609878818915,"title":"橡木紋","option1":"橡木紋","option2":null,"option3":null,"sku":"SSA0105558","requires_shipping":true,"taxable":true,"featured_image":{"id":3963491287139,"product_id":1432684101731,"position":1,"created_at":"2018-10-05T18:56:12+08:00","updated_at":"2021-09-02T17:20:54+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/oak_i8p.png?v=1630574454","variant_ids":[12609878818915]},"available":true,"name":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列 - 橡木紋","public_title":"橡木紋","options":["橡木紋"],"price":98000,"weight":100,"compare_at_price":null,"inventory_quantity":-1490,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":967284785251,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/oak_i8p.png?v=1630574454"}}},{"id":12609878917219,"title":"皮革","option1":"皮革","option2":null,"option3":null,"sku":"SSA0105561","requires_shipping":true,"taxable":true,"featured_image":{"id":3963491024995,"product_id":1432684101731,"position":2,"created_at":"2018-10-05T18:56:04+08:00","updated_at":"2021-09-02T17:20:54+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/leather_i8p.png?v=1630574454","variant_ids":[12609878917219]},"available":true,"name":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列 - 皮革","public_title":"皮革","options":["皮革"],"price":98000,"weight":100,"compare_at_price":null,"inventory_quantity":-465,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":967284686947,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/leather_i8p.png?v=1630574454"}}},{"id":12609878949987,"title":"碳纖維","option1":"碳纖維","option2":null,"option3":null,"sku":"SSA0105549","requires_shipping":true,"taxable":true,"featured_image":{"id":3963490205795,"product_id":1432684101731,"position":3,"created_at":"2018-10-05T18:55:36+08:00","updated_at":"2021-09-02T17:20:54+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-04.png?v=1630574454","variant_ids":[12609878949987]},"available":true,"name":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列 - 碳纖維","public_title":"碳纖維","options":["碳纖維"],"price":83000,"weight":100,"compare_at_price":null,"inventory_quantity":-4412,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":967284260963,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-04.png?v=1630574454"}}},{"id":12609878982755,"title":"經典黑","option1":"經典黑","option2":null,"option3":null,"sku":"SSA0105552","requires_shipping":true,"taxable":true,"featured_image":{"id":3963489943651,"product_id":1432684101731,"position":4,"created_at":"2018-10-05T18:55:29+08:00","updated_at":"2020-05-26T12:16:30+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-02.png?v=1590466590","variant_ids":[12609878982755]},"available":true,"name":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列 - 經典黑","public_title":"經典黑","options":["經典黑"],"price":73000,"weight":100,"compare_at_price":null,"inventory_quantity":-4954,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":967284162659,"position":4,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-02.png?v=1590466590"}}},{"id":12609879015523,"title":"櫻花粉","option1":"櫻花粉","option2":null,"option3":null,"sku":"SSA0105557","requires_shipping":true,"taxable":true,"featured_image":{"id":4051153616995,"product_id":1432684101731,"position":5,"created_at":"2018-11-01T16:49:25+08:00","updated_at":"2021-09-02T17:20:54+08:00","alt":null,"width":600,"height":600,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/7_8_grande_2b4bb619-4461-453a-beb6-a98ebf33fdd0.png?v=1630574454","variant_ids":[12609879015523]},"available":true,"name":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列 - 櫻花粉","public_title":"櫻花粉","options":["櫻花粉"],"price":73000,"weight":100,"compare_at_price":null,"inventory_quantity":-1952,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":982586589283,"position":5,"preview_image":{"aspect_ratio":1.0,"height":600,"width":600,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/7_8_grande_2b4bb619-4461-453a-beb6-a98ebf33fdd0.png?v=1630574454"}}},{"id":12609879081059,"title":"經典白","option1":"經典白","option2":null,"option3":null,"sku":"SSA0105553","requires_shipping":true,"taxable":true,"featured_image":{"id":3963489845347,"product_id":1432684101731,"position":6,"created_at":"2018-10-05T18:55:25+08:00","updated_at":"2021-09-02T17:20:54+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-01.png?v=1630574454","variant_ids":[12609879081059]},"available":true,"name":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列 - 經典白","public_title":"經典白","options":["經典白"],"price":73000,"weight":100,"compare_at_price":null,"inventory_quantity":-925,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":967284064355,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-01.png?v=1630574454"}}},{"id":12609879146595,"title":"髮絲紋","option1":"髮絲紋","option2":null,"option3":null,"sku":"SSA0105568","requires_shipping":true,"taxable":true,"featured_image":{"id":28930405204067,"product_id":1432684101731,"position":13,"created_at":"2022-03-09T17:37:27+08:00","updated_at":"2022-03-09T17:37:27+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-05_5ec57b9a-0900-4c84-9a2a-361ae9313e79.png?v=1646818647","variant_ids":[12609879146595]},"available":true,"name":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列 - 髮絲紋","public_title":"髮絲紋","options":["髮絲紋"],"price":98000,"weight":100,"compare_at_price":null,"inventory_quantity":-1028,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":21264921559139,"position":13,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-05_5ec57b9a-0900-4c84-9a2a-361ae9313e79.png?v=1646818647"}}},{"id":39537943609443,"title":"海軍藍","option1":"海軍藍","option2":null,"option3":null,"sku":"SSA01055J5","requires_shipping":true,"taxable":true,"featured_image":{"id":28519083933795,"product_id":1432684101731,"position":10,"created_at":"2021-09-06T11:35:20+08:00","updated_at":"2021-09-06T11:35:20+08:00","alt":null,"width":1999,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/new-bumper-back-45degree-SSA01055J5.png?v=1630899320","variant_ids":[39537943609443]},"available":true,"name":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列 - 海軍藍","public_title":"海軍藍","options":["海軍藍"],"price":73000,"weight":100,"compare_at_price":null,"inventory_quantity":-287,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":20831977406563,"position":10,"preview_image":{"aspect_ratio":1.333,"height":1500,"width":1999,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/new-bumper-back-45degree-SSA01055J5.png?v=1630899320"}}},{"id":39533871005795,"title":"暗夜綠","option1":"暗夜綠","option2":null,"option3":null,"sku":"SSA01055K8","requires_shipping":true,"taxable":true,"featured_image":{"id":28509378084963,"product_id":1432684101731,"position":11,"created_at":"2021-09-02T17:20:54+08:00","updated_at":"2021-09-02T17:20:54+08:00","alt":null,"width":1999,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/SSA-iPhone_7__Black-7_8__Back45_SSA_Dark_Teal-Dark_Teal-Button_3eb49e50-6a8a-4ae8-a48c-d4272af51969.png?v=1630574454","variant_ids":[39533871005795]},"available":true,"name":"犀牛盾SolidSuit防摔背蓋手機殼 - iPhone 7 Plus \/ 8 Plus系列 - 暗夜綠","public_title":"暗夜綠","options":["暗夜綠"],"price":73000,"weight":100,"compare_at_price":null,"inventory_quantity":-191,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":20821809430627,"position":11,"preview_image":{"aspect_ratio":1.333,"height":1500,"width":1999,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/SSA-iPhone_7__Black-7_8__Back45_SSA_Dark_Teal-Dark_Teal-Button_3eb49e50-6a8a-4ae8-a48c-d4272af51969.png?v=1630574454"}}}],"images":["\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/oak_i8p.png?v=1630574454","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/leather_i8p.png?v=1630574454","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-04.png?v=1630574454","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-02.png?v=1590466590","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/7_8_grande_2b4bb619-4461-453a-beb6-a98ebf33fdd0.png?v=1630574454","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-01.png?v=1630574454","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-06_761fb3ae-387b-45f3-a7f5-3e23ab850f49.png?v=1630574454","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iPhone7__JetBlack.png?v=1630574454","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iPhone7__JetBlack_d31fe9e0-d100-47c2-92f2-ce007034311a.png?v=1630574454","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/new-bumper-back-45degree-SSA01055J5.png?v=1630899320","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/SSA-iPhone_7__Black-7_8__Back45_SSA_Dark_Teal-Dark_Teal-Button_3eb49e50-6a8a-4ae8-a48c-d4272af51969.png?v=1630574454","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iPhone7__JetBlack_6603163b-077b-4535-931e-eb688fa1c7d7.png?v=1645610890","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-05_5ec57b9a-0900-4c84-9a2a-361ae9313e79.png?v=1646818647"],"featured_image":"\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/oak_i8p.png?v=1630574454","options":["Color"],"media":[{"alt":null,"id":967284785251,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/oak_i8p.png?v=1630574454"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/oak_i8p.png?v=1630574454","width":1500},{"alt":null,"id":967284686947,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/leather_i8p.png?v=1630574454"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/leather_i8p.png?v=1630574454","width":1500},{"alt":null,"id":967284260963,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-04.png?v=1630574454"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-04.png?v=1630574454","width":1500},{"alt":null,"id":967284162659,"position":4,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-02.png?v=1590466590"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-02.png?v=1590466590","width":1500},{"alt":null,"id":982586589283,"position":5,"preview_image":{"aspect_ratio":1.0,"height":600,"width":600,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/7_8_grande_2b4bb619-4461-453a-beb6-a98ebf33fdd0.png?v=1630574454"},"aspect_ratio":1.0,"height":600,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/7_8_grande_2b4bb619-4461-453a-beb6-a98ebf33fdd0.png?v=1630574454","width":600},{"alt":null,"id":967284064355,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-01.png?v=1630574454"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-01.png?v=1630574454","width":1500},{"alt":null,"id":967284490339,"position":7,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-06_761fb3ae-387b-45f3-a7f5-3e23ab850f49.png?v=1630574454"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-06_761fb3ae-387b-45f3-a7f5-3e23ab850f49.png?v=1630574454","width":1500},{"alt":null,"id":7219351486563,"position":8,"preview_image":{"aspect_ratio":1.333,"height":1500,"width":1999,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iPhone7__JetBlack.png?v=1630574454"},"aspect_ratio":1.333,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iPhone7__JetBlack.png?v=1630574454","width":1999},{"alt":null,"id":20664829313123,"position":9,"preview_image":{"aspect_ratio":1.333,"height":1500,"width":1999,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iPhone7__JetBlack_d31fe9e0-d100-47c2-92f2-ce007034311a.png?v=1630574454"},"aspect_ratio":1.333,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iPhone7__JetBlack_d31fe9e0-d100-47c2-92f2-ce007034311a.png?v=1630574454","width":1999},{"alt":null,"id":20831977406563,"position":10,"preview_image":{"aspect_ratio":1.333,"height":1500,"width":1999,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/new-bumper-back-45degree-SSA01055J5.png?v=1630899320"},"aspect_ratio":1.333,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/new-bumper-back-45degree-SSA01055J5.png?v=1630899320","width":1999},{"alt":null,"id":20821809430627,"position":11,"preview_image":{"aspect_ratio":1.333,"height":1500,"width":1999,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/SSA-iPhone_7__Black-7_8__Back45_SSA_Dark_Teal-Dark_Teal-Button_3eb49e50-6a8a-4ae8-a48c-d4272af51969.png?v=1630574454"},"aspect_ratio":1.333,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/SSA-iPhone_7__Black-7_8__Back45_SSA_Dark_Teal-Dark_Teal-Button_3eb49e50-6a8a-4ae8-a48c-d4272af51969.png?v=1630574454","width":1999},{"alt":null,"id":21198630584419,"position":12,"preview_image":{"aspect_ratio":1.333,"height":1500,"width":1999,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iPhone7__JetBlack_6603163b-077b-4535-931e-eb688fa1c7d7.png?v=1645610890"},"aspect_ratio":1.333,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iPhone7__JetBlack_6603163b-077b-4535-931e-eb688fa1c7d7.png?v=1645610890","width":1999},{"alt":null,"id":21264921559139,"position":13,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-05_5ec57b9a-0900-4c84-9a2a-361ae9313e79.png?v=1646818647"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/0330-20_solidsuit-8_-05_5ec57b9a-0900-4c84-9a2a-361ae9313e79.png?v=1646818647","width":1500}],"content":""}; $bumper = null; if ($bumper) { $(document).ready(function() { var productImg = $product.images[0] var bumperVariants = $bumper.variants; var bumperColors = new Object(); var currentVariant = ''; var productType = ''; bumperVariants.forEach(variant => { bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src; }); if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') { mergeImages([productImg, bumperColors[currentVariant]],{ crossOrigin: 'anonymous' }) .then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } else { mergeImages([bumperColors[currentVariant], productImg],{ crossOrigin: 'anonymous' }) .then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } }); } $(function() { // switch device $('#select-device').on('change', function() { window.location.href = $(this).val(); }); // listen quantity changed $('input[name=quantity]').on('change', function() { var quantity = $(this).val(); }); // checkbox action $("input:checkbox").on('click', function() { // in the handler, 'this' refers to the box clicked on var $box = $(this); if ($box.is(":checked")) { // the name of the box is retrieved using the .attr() method // as it is assumed and expected to be immutable var group = "input:checkbox[name='" + $box.attr("name") + "']"; // the checked state of the group/box on the other hand will change // and the current value is retrieved using .prop() method $(group).prop("checked", false); $box.prop("checked", true); } else { $box.prop("checked", false); } }); // add to cart $("#AddToCart-product-template").click(function(e){ var elem; var addition = {}; Shopify.queue = []; e.preventDefault(); // elem = $(this); // $(elem).prop("disabled", true); var original_variant_id = $('.product-form').serialize().split('&')[0].split('=')[1]; var original_variant_quantity = $('.product-form').serialize().split('&')[1].split('=')[1]; addition.id = original_variant_id; addition.quantity = original_variant_quantity; Shopify.queue.push(addition); $.each($("input[name^='recommend[']:checked"), function(i, v) { var addition = {}; var name = $(this).attr('name'); var quantity = $('select[name="' + name + '"]').val(); addition.id = $(this).val(); addition.quantity = quantity; Shopify.queue.push(addition); }); Shopify.moveAlong(); }); Shopify.moveAlong = function() { // If we still have requests in the queue, let's process the next one. // console.log(Shopify.queue); if (Shopify.queue.length) { var request = Shopify.queue.shift(); Shopify.addItem(request.id, request.quantity, Shopify.moveAlong); } // If the queue is empty, take care of the main item else { $.getJSON('/cart.js', function(cart) { $('#CartCount').removeClass('hide'); $('#item-count').text(cart.item_count); toastr.options = { "closeButton": false, "debug": false, "newestOnTop": false, "progressBar": false, "positionClass": "toast-bottom-right", "preventDuplicates": false, "onclick": null, "showDuration": "300", "hideDuration": "1000", "timeOut": "5000", "extendedTimeOut": "1000", "showEasing": "swing", "hideEasing": "linear", "showMethod": "fadeIn", "hideMethod": "fadeOut" }; toastr["success"]("成功加入購物車"); }); } }; });
// Override default values of shop.strings for each template. // Alternate product templates can change values of // add to cart button, sold out, and unavailable states here. theme.productStrings = { addToCart: "加到購物車", soldOut: "售完", unavailable: "停產" }