$product = {"id":7892691255395,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for","handle":"iphone-12-pro-mod-nx-magsafe-printable-aar08","description":null,"published_at":"2025-10-03T09:39:17+08:00","created_at":"2025-10-02T10:12:36+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":110000,"price_min":110000,"price_max":110000,"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":43756787794019,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543842426979,"product_id":7892691255395,"position":4,"created_at":"2025-10-02T10:12:41+08:00","updated_at":"2025-10-02T10:12:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bbd125abb8b8f24427832672614235c039d6519d.webp?v=1759371163","variant_ids":[43756787794019]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-AAR08","featured_media":{"alt":null,"id":26113597309027,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bbd125abb8b8f24427832672614235c039d6519d.webp?v=1759371163"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756790284387,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543843442787,"product_id":7892691255395,"position":10,"created_at":"2025-10-02T10:12:45+08:00","updated_at":"2025-10-02T10:12:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b9c5b05cc66d58d134f86dea94795641089fc1f.webp?v=1759371167","variant_ids":[43756790284387]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185J5-AAR08","featured_media":{"alt":null,"id":26113598324835,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b9c5b05cc66d58d134f86dea94795641089fc1f.webp?v=1759371167"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756790317155,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543842394211,"product_id":7892691255395,"position":3,"created_at":"2025-10-02T10:12:39+08:00","updated_at":"2025-10-02T10:12:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9dc639c9b006f8edddfd1f7024d03c88c2eccdb.webp?v=1759371161","variant_ids":[43756790317155]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-AAR08","featured_media":{"alt":null,"id":26113597276259,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9dc639c9b006f8edddfd1f7024d03c88c2eccdb.webp?v=1759371161"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756790382691,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543842689123,"product_id":7892691255395,"position":6,"created_at":"2025-10-02T10:12:42+08:00","updated_at":"2025-10-02T10:12:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b37ab678b84af9423cc86bd92f459af0cecf01.webp?v=1759371164","variant_ids":[43756790382691]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-AAR08","featured_media":{"alt":null,"id":26113597571171,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b37ab678b84af9423cc86bd92f459af0cecf01.webp?v=1759371164"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756790513763,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543843246179,"product_id":7892691255395,"position":9,"created_at":"2025-10-02T10:12:44+08:00","updated_at":"2025-10-02T10:12:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846e456b1934f6235e874e7cfcd6aef3a877ad4d.webp?v=1759371166","variant_ids":[43756790513763]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-AAR08","featured_media":{"alt":null,"id":26113598128227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846e456b1934f6235e874e7cfcd6aef3a877ad4d.webp?v=1759371166"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3949abfea6d62f4e738885a56a002e2b2978fe04.webp?v=1759371159","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b357b61139a5ebbc560a37288928c645e41aee11.webp?v=1759371160","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9dc639c9b006f8edddfd1f7024d03c88c2eccdb.webp?v=1759371161","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bbd125abb8b8f24427832672614235c039d6519d.webp?v=1759371163","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60e5caaf27722f7c2fa2c22ef0749dc194a0c3.webp?v=1759371163","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b37ab678b84af9423cc86bd92f459af0cecf01.webp?v=1759371164","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5bc7dbcd720ac53efbf76c88b23ab62f82b909e.webp?v=1759371165","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/221316ed84eb3443925dac86b37eb1d820bb2892.webp?v=1759371165","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846e456b1934f6235e874e7cfcd6aef3a877ad4d.webp?v=1759371166","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b9c5b05cc66d58d134f86dea94795641089fc1f.webp?v=1759371167","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86cbb540a22e3697adcff84b100cbcf3d92c3c26.webp?v=1759371167"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3949abfea6d62f4e738885a56a002e2b2978fe04.webp?v=1759371159","options":["color"],"media":[{"alt":null,"id":26113597079651,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3949abfea6d62f4e738885a56a002e2b2978fe04.webp?v=1759371159"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3949abfea6d62f4e738885a56a002e2b2978fe04.webp?v=1759371159","width":2000},{"alt":null,"id":26113597177955,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b357b61139a5ebbc560a37288928c645e41aee11.webp?v=1759371160"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b357b61139a5ebbc560a37288928c645e41aee11.webp?v=1759371160","width":2000},{"alt":null,"id":26113597276259,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9dc639c9b006f8edddfd1f7024d03c88c2eccdb.webp?v=1759371161"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9dc639c9b006f8edddfd1f7024d03c88c2eccdb.webp?v=1759371161","width":2000},{"alt":null,"id":26113597309027,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bbd125abb8b8f24427832672614235c039d6519d.webp?v=1759371163"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bbd125abb8b8f24427832672614235c039d6519d.webp?v=1759371163","width":2000},{"alt":null,"id":26113597472867,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60e5caaf27722f7c2fa2c22ef0749dc194a0c3.webp?v=1759371163"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d60e5caaf27722f7c2fa2c22ef0749dc194a0c3.webp?v=1759371163","width":2000},{"alt":null,"id":26113597571171,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b37ab678b84af9423cc86bd92f459af0cecf01.webp?v=1759371164"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b37ab678b84af9423cc86bd92f459af0cecf01.webp?v=1759371164","width":2000},{"alt":null,"id":26113597767779,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5bc7dbcd720ac53efbf76c88b23ab62f82b909e.webp?v=1759371165"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5bc7dbcd720ac53efbf76c88b23ab62f82b909e.webp?v=1759371165","width":2000},{"alt":null,"id":26113597964387,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/221316ed84eb3443925dac86b37eb1d820bb2892.webp?v=1759371165"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/221316ed84eb3443925dac86b37eb1d820bb2892.webp?v=1759371165","width":2000},{"alt":null,"id":26113598128227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846e456b1934f6235e874e7cfcd6aef3a877ad4d.webp?v=1759371166"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846e456b1934f6235e874e7cfcd6aef3a877ad4d.webp?v=1759371166","width":2000},{"alt":null,"id":26113598324835,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b9c5b05cc66d58d134f86dea94795641089fc1f.webp?v=1759371167"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b9c5b05cc66d58d134f86dea94795641089fc1f.webp?v=1759371167","width":2000},{"alt":null,"id":26113598586979,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86cbb540a22e3697adcff84b100cbcf3d92c3c26.webp?v=1759371167"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86cbb540a22e3697adcff84b100cbcf3d92c3c26.webp?v=1759371167","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43756787794019,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543842426979,"product_id":7892691255395,"position":4,"created_at":"2025-10-02T10:12:41+08:00","updated_at":"2025-10-02T10:12:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bbd125abb8b8f24427832672614235c039d6519d.webp?v=1759371163","variant_ids":[43756787794019]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-AAR08","featured_media":{"alt":null,"id":26113597309027,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bbd125abb8b8f24427832672614235c039d6519d.webp?v=1759371163"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756790284387,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543843442787,"product_id":7892691255395,"position":10,"created_at":"2025-10-02T10:12:45+08:00","updated_at":"2025-10-02T10:12:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b9c5b05cc66d58d134f86dea94795641089fc1f.webp?v=1759371167","variant_ids":[43756790284387]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185J5-AAR08","featured_media":{"alt":null,"id":26113598324835,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b9c5b05cc66d58d134f86dea94795641089fc1f.webp?v=1759371167"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756790317155,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543842394211,"product_id":7892691255395,"position":3,"created_at":"2025-10-02T10:12:39+08:00","updated_at":"2025-10-02T10:12:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9dc639c9b006f8edddfd1f7024d03c88c2eccdb.webp?v=1759371161","variant_ids":[43756790317155]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-AAR08","featured_media":{"alt":null,"id":26113597276259,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9dc639c9b006f8edddfd1f7024d03c88c2eccdb.webp?v=1759371161"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756790382691,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543842689123,"product_id":7892691255395,"position":6,"created_at":"2025-10-02T10:12:42+08:00","updated_at":"2025-10-02T10:12:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b37ab678b84af9423cc86bd92f459af0cecf01.webp?v=1759371164","variant_ids":[43756790382691]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-AAR08","featured_media":{"alt":null,"id":26113597571171,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f1b37ab678b84af9423cc86bd92f459af0cecf01.webp?v=1759371164"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756790513763,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543843246179,"product_id":7892691255395,"position":9,"created_at":"2025-10-02T10:12:44+08:00","updated_at":"2025-10-02T10:12:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846e456b1934f6235e874e7cfcd6aef3a877ad4d.webp?v=1759371166","variant_ids":[43756790513763]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-AAR08","featured_media":{"alt":null,"id":26113598128227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846e456b1934f6235e874e7cfcd6aef3a877ad4d.webp?v=1759371166"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43756787794019,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-AAR08","requires_shipping":true,"taxable":true,"featured_image":{"id":34543842426979,"product_id":7892691255395,"position":4,"created_at":"2025-10-02T10:12:41+08:00","updated_at":"2025-10-02T10:12:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bbd125abb8b8f24427832672614235c039d6519d.webp?v=1759371163","variant_ids":[43756787794019]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Aaron Chang Waiting for - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-AAR08","featured_media":{"alt":null,"id":26113597309027,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bbd125abb8b8f24427832672614235c039d6519d.webp?v=1759371163"}},"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: "停產" }