Shopify.queue = []; $product = {"id":1414792609891,"title":"犀牛盾Mod NX防摔手機殼 - iPhone X","handle":"iphone-x-mod-nx","description":"\u003cp\u003e\u003cspan style=\"color: #0000ff;\"\u003e\u003cstrong\u003eQ:Mod NX背板內側有一片貼膜是可以撕掉的嗎?\u003c\/strong\u003e\u003cbr\u003eA:Mod NX背板由內側加入一片防刮膜來優化耐刮功能, 也因為耐刮內膜無法被重複黏貼, 請不要將此片內膜撕除。\u003cbr\u003e\u003c\/span\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #0000ff;\"\u003e\u003cbr\u003e\u003cstrong\u003eQ:Mod NX商品是否相容滿版保護貼和背面保護貼?\u003c\/strong\u003e\u003cbr\u003eA:\u003c\/span\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #0000ff;\"\u003e1. Mod NX適用一般市售螢幕滿版保護貼,但是因為市售螢幕玻璃保護貼廠牌較多,每一片保護貼設計螢幕的覆蓋範圍較無法一一測試,所以需以實際安裝結果為主。\u003c\/span\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #0000ff;\"\u003e2.犀牛盾耐衝擊背貼:Mod NX 無論邊框模組或是背蓋模組“皆可以相容”它牌滿版玻璃背貼:因為Mod NX保護殼設計較包覆,背面玻璃保護貼將“無法相容”\u003c\/span\u003e\u003c\/p\u003e","published_at":"2018-08-01T19:41:55+08:00","created_at":"2018-07-31T16:08:10+08:00","vendor":"犀牛盾有限公司","type":"ModNX","tags":["20%","25%","30%","35%","40%","45%","50%","brand-Apple","bumper-clearplate","device-iphone X","dropdownDevice-Apple iPhone X","iPhone X","member","quickbuy","reseller","reseller-asus","Top50"],"price":80000,"price_min":80000,"price_max":80000,"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":12566931701859,"title":"白色","option1":"白色","option2":null,"option3":null,"sku":"NPB0106404","requires_shipping":true,"taxable":true,"featured_image":{"id":3795961479267,"product_id":1414792609891,"position":6,"created_at":"2018-07-31T16:24:27+08:00","updated_at":"2021-06-21T15:32:46+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/white_blackhone.png?v=1624260766","variant_ids":[12566931701859]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 白色","public_title":"白色","options":["白色"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-1497,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":927446270051,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/white_blackhone.png?v=1569079414"}}},{"id":12566931734627,"title":"黃色","option1":"黃色","option2":null,"option3":null,"sku":"NPB0106409","requires_shipping":true,"taxable":true,"featured_image":{"id":3795961053283,"product_id":1414792609891,"position":2,"created_at":"2018-07-31T16:24:10+08:00","updated_at":"2021-06-21T15:32:46+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/yellow_blackphone.png?v=1624260766","variant_ids":[12566931734627]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 黃色","public_title":"黃色","options":["黃色"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-920,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":927445975139,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/yellow_blackphone.png?v=1569079414"}}},{"id":12566931767395,"title":"紅色","option1":"紅色","option2":null,"option3":null,"sku":"NPB0106414","requires_shipping":true,"taxable":true,"featured_image":{"id":3795961413731,"product_id":1414792609891,"position":4,"created_at":"2018-07-31T16:24:21+08:00","updated_at":"2021-06-21T15:32:46+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/red_blackphone.png?v=1624260766","variant_ids":[12566931767395]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 紅色","public_title":"紅色","options":["紅色"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-1526,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":927446204515,"position":4,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/red_blackphone.png?v=1569079414"}}},{"id":12566931800163,"title":"黑色","option1":"黑色","option2":null,"option3":null,"sku":"NPB0106424","requires_shipping":true,"taxable":true,"featured_image":{"id":3795961249891,"product_id":1414792609891,"position":5,"created_at":"2018-07-31T16:24:15+08:00","updated_at":"2021-06-21T15:32:46+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/black_blackphone.png?v=1624260766","variant_ids":[12566931800163]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 黑色","public_title":"黑色","options":["黑色"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-3774,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":927446138979,"position":5,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/black_blackphone.png?v=1569079414"}}},{"id":12566931832931,"title":"櫻花粉","option1":"櫻花粉","option2":null,"option3":null,"sku":"NPB0106457","requires_shipping":true,"taxable":true,"featured_image":{"id":3795961118819,"product_id":1414792609891,"position":1,"created_at":"2018-07-31T16:24:12+08:00","updated_at":"2020-06-10T15:36:05+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/biush_pink_blackphone.png?v=1591774565","variant_ids":[12566931832931]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 櫻花粉","public_title":"櫻花粉","options":["櫻花粉"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-1584,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":927446040675,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/biush_pink_blackphone.png?v=1569079414"}}},{"id":12566931865699,"title":"泥灰","option1":"泥灰","option2":null,"option3":null,"sku":"NPB0106469","requires_shipping":true,"taxable":true,"featured_image":{"id":3795961348195,"product_id":1414792609891,"position":3,"created_at":"2018-07-31T16:24:18+08:00","updated_at":"2021-06-21T15:32:46+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/Graphite_blackphone.png?v=1624260766","variant_ids":[12566931865699]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 泥灰","public_title":"泥灰","options":["泥灰"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-1562,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":927446171747,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/Graphite_blackphone.png?v=1569079414"}}},{"id":12914794299491,"title":"雀藍","option1":"雀藍","option2":null,"option3":null,"sku":"NPB0106477","requires_shipping":true,"taxable":true,"featured_image":{"id":15230704713827,"product_id":1414792609891,"position":10,"created_at":"2020-06-10T15:36:05+08:00","updated_at":"2021-06-21T15:32:47+08:00","alt":null,"width":1999,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/8-phone-Royal_Blue-Frame-8_backplate.png?v=1624260767","variant_ids":[12914794299491]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 雀藍","public_title":"雀藍","options":["雀藍"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-1680,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":7388214263907,"position":10,"preview_image":{"aspect_ratio":1.333,"height":1500,"width":1999,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/8-phone-Royal_Blue-Frame-8_backplate.png?v=1591774565"}}},{"id":31064982061155,"title":"軍綠","option1":"軍綠","option2":null,"option3":null,"sku":"NPB0106415","requires_shipping":true,"taxable":true,"featured_image":{"id":11154517557347,"product_id":1414792609891,"position":7,"created_at":"2019-05-28T12:11:57+08:00","updated_at":"2021-06-21T15:32:46+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Camo_Green-Clear-BP.png?v=1624260766","variant_ids":[31064982061155]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 軍綠","public_title":"軍綠","options":["軍綠"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-253,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":1423572140131,"position":7,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Camo_Green-Clear-BP.png?v=1569176369"}}},{"id":28238158757987,"title":"淺灰","option1":"淺灰","option2":null,"option3":null,"sku":"NPB01064C0","requires_shipping":true,"taxable":true,"featured_image":{"id":11154518114403,"product_id":1414792609891,"position":9,"created_at":"2019-05-28T12:12:07+08:00","updated_at":"2021-06-21T15:32:46+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Platinum_Gray-Clear-BP.png?v=1624260766","variant_ids":[28238158757987]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 淺灰","public_title":"淺灰","options":["淺灰"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-207,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":1423572566115,"position":9,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Platinum_Gray-Clear-BP.png?v=1569176369"}}},{"id":28238160265315,"title":"薰衣紫","option1":"薰衣紫","option2":null,"option3":null,"sku":"NPB01064C1","requires_shipping":true,"taxable":true,"featured_image":{"id":11154517983331,"product_id":1414792609891,"position":8,"created_at":"2019-05-28T12:12:03+08:00","updated_at":"2021-06-21T15:32:46+08:00","alt":null,"width":1500,"height":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Lavender-Clear-BP.png?v=1624260766","variant_ids":[28238160265315]},"available":true,"name":"犀牛盾Mod NX防摔手機殼 - iPhone X - 薰衣紫","public_title":"薰衣紫","options":["薰衣紫"],"price":80000,"weight":100,"compare_at_price":null,"inventory_quantity":-252,"inventory_management":null,"inventory_policy":"deny","barcode":null,"featured_media":{"alt":null,"id":1423572467811,"position":8,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Lavender-Clear-BP.png?v=1569176369"}}}],"images":["\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/biush_pink_blackphone.png?v=1591774565","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/yellow_blackphone.png?v=1624260766","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/Graphite_blackphone.png?v=1624260766","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/red_blackphone.png?v=1624260766","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/black_blackphone.png?v=1624260766","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/white_blackhone.png?v=1624260766","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Camo_Green-Clear-BP.png?v=1624260766","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Lavender-Clear-BP.png?v=1624260766","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Platinum_Gray-Clear-BP.png?v=1624260766","\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/8-phone-Royal_Blue-Frame-8_backplate.png?v=1624260767"],"featured_image":"\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/biush_pink_blackphone.png?v=1591774565","options":["Color"],"media":[{"alt":null,"id":927446040675,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/biush_pink_blackphone.png?v=1569079414"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/biush_pink_blackphone.png?v=1569079414","width":1500},{"alt":null,"id":927445975139,"position":2,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/yellow_blackphone.png?v=1569079414"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/yellow_blackphone.png?v=1569079414","width":1500},{"alt":null,"id":927446171747,"position":3,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/Graphite_blackphone.png?v=1569079414"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/Graphite_blackphone.png?v=1569079414","width":1500},{"alt":null,"id":927446204515,"position":4,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/red_blackphone.png?v=1569079414"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/red_blackphone.png?v=1569079414","width":1500},{"alt":null,"id":927446138979,"position":5,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/black_blackphone.png?v=1569079414"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/black_blackphone.png?v=1569079414","width":1500},{"alt":null,"id":927446270051,"position":6,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/white_blackhone.png?v=1569079414"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/white_blackhone.png?v=1569079414","width":1500},{"alt":null,"id":1423572140131,"position":7,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Camo_Green-Clear-BP.png?v=1569176369"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Camo_Green-Clear-BP.png?v=1569176369","width":1500},{"alt":null,"id":1423572467811,"position":8,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Lavender-Clear-BP.png?v=1569176369"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Lavender-Clear-BP.png?v=1569176369","width":1500},{"alt":null,"id":1423572566115,"position":9,"preview_image":{"aspect_ratio":1.0,"height":1500,"width":1500,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Platinum_Gray-Clear-BP.png?v=1569176369"},"aspect_ratio":1.0,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/iX_Black_-MODNX-Combined-Platinum_Gray-Clear-BP.png?v=1569176369","width":1500},{"alt":null,"id":7388214263907,"position":10,"preview_image":{"aspect_ratio":1.333,"height":1500,"width":1999,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/8-phone-Royal_Blue-Frame-8_backplate.png?v=1591774565"},"aspect_ratio":1.333,"height":1500,"media_type":"image","src":"https:\/\/cdn.shopify.com\/s\/files\/1\/1082\/7110\/products\/8-phone-Royal_Blue-Frame-8_backplate.png?v=1591774565","width":1999}],"content":"\u003cp\u003e\u003cspan style=\"color: #0000ff;\"\u003e\u003cstrong\u003eQ:Mod NX背板內側有一片貼膜是可以撕掉的嗎?\u003c\/strong\u003e\u003cbr\u003eA:Mod NX背板由內側加入一片防刮膜來優化耐刮功能, 也因為耐刮內膜無法被重複黏貼, 請不要將此片內膜撕除。\u003cbr\u003e\u003c\/span\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #0000ff;\"\u003e\u003cbr\u003e\u003cstrong\u003eQ:Mod NX商品是否相容滿版保護貼和背面保護貼?\u003c\/strong\u003e\u003cbr\u003eA:\u003c\/span\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #0000ff;\"\u003e1. Mod NX適用一般市售螢幕滿版保護貼,但是因為市售螢幕玻璃保護貼廠牌較多,每一片保護貼設計螢幕的覆蓋範圍較無法一一測試,所以需以實際安裝結果為主。\u003c\/span\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cspan style=\"color: #0000ff;\"\u003e2.犀牛盾耐衝擊背貼:Mod NX 無論邊框模組或是背蓋模組“皆可以相容”它牌滿版玻璃背貼:因為Mod NX保護殼設計較包覆,背面玻璃保護貼將“無法相容”\u003c\/span\u003e\u003c\/p\u003e"}; $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: "停產" }