$product = {"id":7888367157347,"title":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼","handle":"iphone-12-pro-mod-nx-printable-iq06","description":null,"published_at":"2025-09-23T09:23:43+08:00","created_at":"2025-09-22T15:13:13+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-kingjun","device-iPhone 12 Pro","merge","reseller-kingjun"],"price":90000,"price_min":90000,"price_max":90000,"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":43742842683491,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514131845219,"product_id":7888367157347,"position":6,"created_at":"2025-09-22T15:13:19+08:00","updated_at":"2025-09-22T15:13:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396cc37396e82db3eb9a953f1681c0737a1c4943.webp?v=1758525201","variant_ids":[43742842683491]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-IQ06","featured_media":{"alt":null,"id":26084574396515,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396cc37396e82db3eb9a953f1681c0737a1c4943.webp?v=1758525201"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742845304931,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514132828259,"product_id":7888367157347,"position":11,"created_at":"2025-09-22T15:13:22+08:00","updated_at":"2025-09-22T15:13:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68df8f7aa1f2dfdf6e6193369bc1b103556f184b.webp?v=1758525204","variant_ids":[43742845304931]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-IQ06","featured_media":{"alt":null,"id":26084575346787,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68df8f7aa1f2dfdf6e6193369bc1b103556f184b.webp?v=1758525204"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742845436003,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514132107363,"product_id":7888367157347,"position":7,"created_at":"2025-09-22T15:13:20+08:00","updated_at":"2025-09-22T15:13:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff6ab7680e7a30f9cc8588973abd4fed19edb046.webp?v=1758525202","variant_ids":[43742845436003]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-IQ06","featured_media":{"alt":null,"id":26084574658659,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff6ab7680e7a30f9cc8588973abd4fed19edb046.webp?v=1758525202"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742845534307,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514131484771,"product_id":7888367157347,"position":4,"created_at":"2025-09-22T15:13:18+08:00","updated_at":"2025-09-22T15:13:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ceee1946732a0962d7e3a1a7419fccdd068acc0.webp?v=1758525201","variant_ids":[43742845534307]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-IQ06","featured_media":{"alt":null,"id":26084574003299,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ceee1946732a0962d7e3a1a7419fccdd068acc0.webp?v=1758525201"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742845567075,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514131648611,"product_id":7888367157347,"position":5,"created_at":"2025-09-22T15:13:19+08:00","updated_at":"2025-09-22T15:13:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/954cc43f6672b8131d6e4acef402c448e4082cc7.webp?v=1758525201","variant_ids":[43742845567075]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-IQ06","featured_media":{"alt":null,"id":26084574167139,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/954cc43f6672b8131d6e4acef402c448e4082cc7.webp?v=1758525201"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3aee869adbc5c229e8b666e87572820846a3a225.webp?v=1758525199","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9ecdc7e1ec70c24f1c973fb5f32e552fef38bff.webp?v=1758525199","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ca16aebdca58fd95d54ac11470fcbfb900512ba.webp?v=1758525200","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ceee1946732a0962d7e3a1a7419fccdd068acc0.webp?v=1758525201","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/954cc43f6672b8131d6e4acef402c448e4082cc7.webp?v=1758525201","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396cc37396e82db3eb9a953f1681c0737a1c4943.webp?v=1758525201","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff6ab7680e7a30f9cc8588973abd4fed19edb046.webp?v=1758525202","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4e2af814fb04c6d1ee55ef7c8499268c5b7df17.webp?v=1758525202","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1cc765a35f2cbcdf764fcdc33e53568fc8c9293.webp?v=1758525203","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/311f0d0b90df774f0ebd1f3d2745077d1a6000d7.webp?v=1758525204","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68df8f7aa1f2dfdf6e6193369bc1b103556f184b.webp?v=1758525204"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3aee869adbc5c229e8b666e87572820846a3a225.webp?v=1758525199","options":["color"],"media":[{"alt":null,"id":26084573446243,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3aee869adbc5c229e8b666e87572820846a3a225.webp?v=1758525199"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3aee869adbc5c229e8b666e87572820846a3a225.webp?v=1758525199","width":2000},{"alt":null,"id":26084573577315,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9ecdc7e1ec70c24f1c973fb5f32e552fef38bff.webp?v=1758525199"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9ecdc7e1ec70c24f1c973fb5f32e552fef38bff.webp?v=1758525199","width":2000},{"alt":null,"id":26084573741155,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ca16aebdca58fd95d54ac11470fcbfb900512ba.webp?v=1758525200"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ca16aebdca58fd95d54ac11470fcbfb900512ba.webp?v=1758525200","width":2000},{"alt":null,"id":26084574003299,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ceee1946732a0962d7e3a1a7419fccdd068acc0.webp?v=1758525201"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ceee1946732a0962d7e3a1a7419fccdd068acc0.webp?v=1758525201","width":2000},{"alt":null,"id":26084574167139,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/954cc43f6672b8131d6e4acef402c448e4082cc7.webp?v=1758525201"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/954cc43f6672b8131d6e4acef402c448e4082cc7.webp?v=1758525201","width":2000},{"alt":null,"id":26084574396515,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396cc37396e82db3eb9a953f1681c0737a1c4943.webp?v=1758525201"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396cc37396e82db3eb9a953f1681c0737a1c4943.webp?v=1758525201","width":2000},{"alt":null,"id":26084574658659,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff6ab7680e7a30f9cc8588973abd4fed19edb046.webp?v=1758525202"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff6ab7680e7a30f9cc8588973abd4fed19edb046.webp?v=1758525202","width":2000},{"alt":null,"id":26084574822499,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4e2af814fb04c6d1ee55ef7c8499268c5b7df17.webp?v=1758525202"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4e2af814fb04c6d1ee55ef7c8499268c5b7df17.webp?v=1758525202","width":2000},{"alt":null,"id":26084575051875,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1cc765a35f2cbcdf764fcdc33e53568fc8c9293.webp?v=1758525203"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1cc765a35f2cbcdf764fcdc33e53568fc8c9293.webp?v=1758525203","width":2000},{"alt":null,"id":26084575248483,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/311f0d0b90df774f0ebd1f3d2745077d1a6000d7.webp?v=1758525204"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/311f0d0b90df774f0ebd1f3d2745077d1a6000d7.webp?v=1758525204","width":2000},{"alt":null,"id":26084575346787,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68df8f7aa1f2dfdf6e6193369bc1b103556f184b.webp?v=1758525204"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68df8f7aa1f2dfdf6e6193369bc1b103556f184b.webp?v=1758525204","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43742842683491,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514131845219,"product_id":7888367157347,"position":6,"created_at":"2025-09-22T15:13:19+08:00","updated_at":"2025-09-22T15:13:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396cc37396e82db3eb9a953f1681c0737a1c4943.webp?v=1758525201","variant_ids":[43742842683491]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-IQ06","featured_media":{"alt":null,"id":26084574396515,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396cc37396e82db3eb9a953f1681c0737a1c4943.webp?v=1758525201"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742845304931,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514132828259,"product_id":7888367157347,"position":11,"created_at":"2025-09-22T15:13:22+08:00","updated_at":"2025-09-22T15:13:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68df8f7aa1f2dfdf6e6193369bc1b103556f184b.webp?v=1758525204","variant_ids":[43742845304931]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-IQ06","featured_media":{"alt":null,"id":26084575346787,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68df8f7aa1f2dfdf6e6193369bc1b103556f184b.webp?v=1758525204"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742845436003,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514132107363,"product_id":7888367157347,"position":7,"created_at":"2025-09-22T15:13:20+08:00","updated_at":"2025-09-22T15:13:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff6ab7680e7a30f9cc8588973abd4fed19edb046.webp?v=1758525202","variant_ids":[43742845436003]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-IQ06","featured_media":{"alt":null,"id":26084574658659,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff6ab7680e7a30f9cc8588973abd4fed19edb046.webp?v=1758525202"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742845534307,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514131484771,"product_id":7888367157347,"position":4,"created_at":"2025-09-22T15:13:18+08:00","updated_at":"2025-09-22T15:13:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ceee1946732a0962d7e3a1a7419fccdd068acc0.webp?v=1758525201","variant_ids":[43742845534307]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-IQ06","featured_media":{"alt":null,"id":26084574003299,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ceee1946732a0962d7e3a1a7419fccdd068acc0.webp?v=1758525201"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742845567075,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514131648611,"product_id":7888367157347,"position":5,"created_at":"2025-09-22T15:13:19+08:00","updated_at":"2025-09-22T15:13:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/954cc43f6672b8131d6e4acef402c448e4082cc7.webp?v=1758525201","variant_ids":[43742845567075]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-IQ06","featured_media":{"alt":null,"id":26084574167139,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/954cc43f6672b8131d6e4acef402c448e4082cc7.webp?v=1758525201"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43742842683491,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-IQ06","requires_shipping":true,"taxable":true,"featured_image":{"id":34514131845219,"product_id":7888367157347,"position":6,"created_at":"2025-09-22T15:13:19+08:00","updated_at":"2025-09-22T15:13:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396cc37396e82db3eb9a953f1681c0737a1c4943.webp?v=1758525201","variant_ids":[43742842683491]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 太空貼貼貼 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-IQ06","featured_media":{"alt":null,"id":26084574396515,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396cc37396e82db3eb9a953f1681c0737a1c4943.webp?v=1758525201"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null; $brand_handle = null; $type = ""; var sellingStatus // 只有設計款(SKU 含 '-')才需要合圖 if ($isMerge && $defaultVariant.sku.includes('-')) { $(document).ready(function() { var productImg = $product.images[0]; var bumperImg = window.getProductImageUrl($defaultVariant.sku.split('-')[0]); var layers = ($type === 'mod-nx-backplate' || $type === 'mod-backplate') ? [productImg, bumperImg] : [bumperImg, productImg]; window.mergeProductImages(layers).then(function (mergedImg) { $('.merged-img').attr('src', mergedImg); }); }); }; var sellingStatusData window.fetchSellingStatus().then(data => { try { sellingStatusData = data; } catch (error) { sellingStatusData = null console.error('Unable to parse selling status', error) } $(document).ready(function() { handleSellingStatus($defaultVariant.sku); }); }) function handleSellingStatus(currentSku) { if (!sellingStatusData) { console.error('No selling status available!') return } const sellingStatusElement = document.getElementById('selling-status') const addToCartButton = document.getElementById('AddToCart-product-template') const currentProductSku = currentSku.replace(/-(.*)$/, '-') if ($variants) { const flattenedSellingStatus = [...sellingStatusData.pending, ...sellingStatusData.preorder] const matchSellingStatusProduct = flattenedSellingStatus.filter(product => currentProductSku === product.sku) if (matchSellingStatusProduct.length > 0) { const isProductPending = matchSellingStatusProduct[0].status === 'pending' const matchDate = matchSellingStatusProduct[0].date sellingStatus = isProductPending ? "缺貨中" : "預購完成出貨日:" + matchDate sellingStatusElement.textContent = sellingStatus if (sellingStatus.includes("缺貨中")){ addToCartButton.disabled ='true'; addToCartButton.textContent = "缺貨中無法加入購物車" } else { addToCartButton.textContent = "加到購物車" } } else { sellingStatusElement.textContent = '' addToCartButton.textContent = "加到購物車" }; }; }; document.addEventListener('DOMContentLoaded', function () { var currentVariantSelect = document.getElementById('SingleOptionSelector-0') currentVariantSelect.addEventListener('change', function() { var currentSku = $('#current_sku').text() var skuElement = document.getElementById('current-sku') skuElement.textContent = currentSku handleSellingStatus(currentSku) }); });
// 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: "停產" }