$product = {"id":7892631519331,"title":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang","handle":"iphone-12-pro-mod-nx-printable-aar04","description":null,"published_at":"2025-10-03T09:49:04+08:00","created_at":"2025-10-02T09:56:05+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-aaronchang","device-iPhone 12 Pro","merge","reseller-aaronchang"],"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":43756557369443,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543609249891,"product_id":7892631519331,"position":4,"created_at":"2025-10-02T09:56:11+08:00","updated_at":"2025-10-02T09:56:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b51c8a6958559d93da223de5d60273ce91c88b92.webp?v=1759370174","variant_ids":[43756557369443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113364131939,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b51c8a6958559d93da223de5d60273ce91c88b92.webp?v=1759370174"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756560416867,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543610200163,"product_id":7892631519331,"position":11,"created_at":"2025-10-02T09:56:16+08:00","updated_at":"2025-10-02T09:56:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89b8a58c105c2a151744a8ff63b1638bfb00a83d.webp?v=1759370178","variant_ids":[43756560416867]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113365114979,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89b8a58c105c2a151744a8ff63b1638bfb00a83d.webp?v=1759370178"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756560449635,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543609774179,"product_id":7892631519331,"position":9,"created_at":"2025-10-02T09:56:15+08:00","updated_at":"2025-10-02T09:56:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4829da5183f4ec0ba1d89ce5c98856e424a1cdd4.webp?v=1759370177","variant_ids":[43756560449635]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113364656227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4829da5183f4ec0ba1d89ce5c98856e424a1cdd4.webp?v=1759370177"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756560515171,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543608692835,"product_id":7892631519331,"position":1,"created_at":"2025-10-02T09:56:09+08:00","updated_at":"2025-10-02T09:56:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e9e1b9977d417471788cd2a48b3a8fab4084b6f.webp?v=1759370171","variant_ids":[43756560515171]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113363574883,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e9e1b9977d417471788cd2a48b3a8fab4084b6f.webp?v=1759370171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756560646243,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543609544803,"product_id":7892631519331,"position":7,"created_at":"2025-10-02T09:56:13+08:00","updated_at":"2025-10-02T09:56:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a76988622491f984ef3da2d5734956d525d1a59a.webp?v=1759370176","variant_ids":[43756560646243]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113364426851,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a76988622491f984ef3da2d5734956d525d1a59a.webp?v=1759370176"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e9e1b9977d417471788cd2a48b3a8fab4084b6f.webp?v=1759370171","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/977c422c0118e31c738a9e1f8235bf1ed0fa9075.webp?v=1759370172","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c471009fc22967051b19c9cb7fd34e73e6b4e85.webp?v=1759370173","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b51c8a6958559d93da223de5d60273ce91c88b92.webp?v=1759370174","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54699273f1ace9168e393c71d284b07e89478d0b.webp?v=1759370174","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2d64222d06f860c8ab1ea83069d0f5a044a76b0.webp?v=1759370175","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a76988622491f984ef3da2d5734956d525d1a59a.webp?v=1759370176","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43032f0e887299e093fdebf8413893f2abdde952.webp?v=1759370176","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4829da5183f4ec0ba1d89ce5c98856e424a1cdd4.webp?v=1759370177","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51909d30e8cdada0a824d00da191765fb85bf36d.webp?v=1759370178","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89b8a58c105c2a151744a8ff63b1638bfb00a83d.webp?v=1759370178"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e9e1b9977d417471788cd2a48b3a8fab4084b6f.webp?v=1759370171","options":["color"],"media":[{"alt":null,"id":26113363574883,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e9e1b9977d417471788cd2a48b3a8fab4084b6f.webp?v=1759370171"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e9e1b9977d417471788cd2a48b3a8fab4084b6f.webp?v=1759370171","width":2000},{"alt":null,"id":26113363837027,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/977c422c0118e31c738a9e1f8235bf1ed0fa9075.webp?v=1759370172"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/977c422c0118e31c738a9e1f8235bf1ed0fa9075.webp?v=1759370172","width":2000},{"alt":null,"id":26113364000867,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c471009fc22967051b19c9cb7fd34e73e6b4e85.webp?v=1759370173"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c471009fc22967051b19c9cb7fd34e73e6b4e85.webp?v=1759370173","width":2000},{"alt":null,"id":26113364131939,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b51c8a6958559d93da223de5d60273ce91c88b92.webp?v=1759370174"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b51c8a6958559d93da223de5d60273ce91c88b92.webp?v=1759370174","width":2000},{"alt":null,"id":26113364263011,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54699273f1ace9168e393c71d284b07e89478d0b.webp?v=1759370174"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54699273f1ace9168e393c71d284b07e89478d0b.webp?v=1759370174","width":2000},{"alt":null,"id":26113364361315,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2d64222d06f860c8ab1ea83069d0f5a044a76b0.webp?v=1759370175"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2d64222d06f860c8ab1ea83069d0f5a044a76b0.webp?v=1759370175","width":2000},{"alt":null,"id":26113364426851,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a76988622491f984ef3da2d5734956d525d1a59a.webp?v=1759370176"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a76988622491f984ef3da2d5734956d525d1a59a.webp?v=1759370176","width":2000},{"alt":null,"id":26113364525155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43032f0e887299e093fdebf8413893f2abdde952.webp?v=1759370176"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43032f0e887299e093fdebf8413893f2abdde952.webp?v=1759370176","width":2000},{"alt":null,"id":26113364656227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4829da5183f4ec0ba1d89ce5c98856e424a1cdd4.webp?v=1759370177"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4829da5183f4ec0ba1d89ce5c98856e424a1cdd4.webp?v=1759370177","width":2000},{"alt":null,"id":26113364918371,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51909d30e8cdada0a824d00da191765fb85bf36d.webp?v=1759370178"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51909d30e8cdada0a824d00da191765fb85bf36d.webp?v=1759370178","width":2000},{"alt":null,"id":26113365114979,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89b8a58c105c2a151744a8ff63b1638bfb00a83d.webp?v=1759370178"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89b8a58c105c2a151744a8ff63b1638bfb00a83d.webp?v=1759370178","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43756557369443,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543609249891,"product_id":7892631519331,"position":4,"created_at":"2025-10-02T09:56:11+08:00","updated_at":"2025-10-02T09:56:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b51c8a6958559d93da223de5d60273ce91c88b92.webp?v=1759370174","variant_ids":[43756557369443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113364131939,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b51c8a6958559d93da223de5d60273ce91c88b92.webp?v=1759370174"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756560416867,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543610200163,"product_id":7892631519331,"position":11,"created_at":"2025-10-02T09:56:16+08:00","updated_at":"2025-10-02T09:56:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89b8a58c105c2a151744a8ff63b1638bfb00a83d.webp?v=1759370178","variant_ids":[43756560416867]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113365114979,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/89b8a58c105c2a151744a8ff63b1638bfb00a83d.webp?v=1759370178"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756560449635,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543609774179,"product_id":7892631519331,"position":9,"created_at":"2025-10-02T09:56:15+08:00","updated_at":"2025-10-02T09:56:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4829da5183f4ec0ba1d89ce5c98856e424a1cdd4.webp?v=1759370177","variant_ids":[43756560449635]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113364656227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4829da5183f4ec0ba1d89ce5c98856e424a1cdd4.webp?v=1759370177"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756560515171,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543608692835,"product_id":7892631519331,"position":1,"created_at":"2025-10-02T09:56:09+08:00","updated_at":"2025-10-02T09:56:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e9e1b9977d417471788cd2a48b3a8fab4084b6f.webp?v=1759370171","variant_ids":[43756560515171]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113363574883,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e9e1b9977d417471788cd2a48b3a8fab4084b6f.webp?v=1759370171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756560646243,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543609544803,"product_id":7892631519331,"position":7,"created_at":"2025-10-02T09:56:13+08:00","updated_at":"2025-10-02T09:56:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a76988622491f984ef3da2d5734956d525d1a59a.webp?v=1759370176","variant_ids":[43756560646243]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113364426851,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a76988622491f984ef3da2d5734956d525d1a59a.webp?v=1759370176"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43756557369443,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":34543609249891,"product_id":7892631519331,"position":4,"created_at":"2025-10-02T09:56:11+08:00","updated_at":"2025-10-02T09:56:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b51c8a6958559d93da223de5d60273ce91c88b92.webp?v=1759370174","variant_ids":[43756557369443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Aaron Chang Yin\u0026Yang - 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-AAR04","featured_media":{"alt":null,"id":26113364131939,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b51c8a6958559d93da223de5d60273ce91c88b92.webp?v=1759370174"}},"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: "停產" }