$product = {"id":7892599701603,"title":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang","handle":"iphone-xr-solidsuit-classic-aar04","description":null,"published_at":"2025-10-03T09:54:21+08:00","created_at":"2025-10-02T09:43:55+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-aaronchang","device-iPhone XR","merge","reseller-aaronchang"],"price":83000,"price_min":83000,"price_max":83000,"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":43756437864547,"title":"White","option1":"White","option2":null,"option3":null,"sku":"SST0108553-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":36321982283875,"product_id":7892599701603,"position":11,"created_at":"2026-07-20T16:33:02+08:00","updated_at":"2026-07-20T16:33:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6_072c7e86-d276-4854-8720-729c28cc7e40.webp?v=1784536384","variant_ids":[43756437864547]},"available":true,"name":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang - White","public_title":"White","options":["White"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108553-AAR04","featured_media":{"alt":null,"id":27825894064227,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6_072c7e86-d276-4854-8720-729c28cc7e40.webp?v=1784536384"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756437930083,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"SST0108557-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":36321981169763,"product_id":7892599701603,"position":9,"created_at":"2026-07-20T16:32:52+08:00","updated_at":"2026-07-20T16:32:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216_cf63f04c-64c3-40c7-a24f-d64aad59ac03.webp?v=1784536374","variant_ids":[43756437930083]},"available":true,"name":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108557-AAR04","featured_media":{"alt":null,"id":27825892982883,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216_cf63f04c-64c3-40c7-a24f-d64aad59ac03.webp?v=1784536374"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756437962851,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0108552-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":36321980743779,"product_id":7892599701603,"position":8,"created_at":"2026-07-20T16:32:49+08:00","updated_at":"2026-07-20T16:32:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000_100f79d7-6208-48b9-b867-8579e4a6307e.webp?v=1784536372","variant_ids":[43756437962851]},"available":true,"name":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108552-AAR04","featured_media":{"alt":null,"id":27825892524131,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000_100f79d7-6208-48b9-b867-8579e4a6307e.webp?v=1784536372"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756437995619,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01085O8-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":36321983201379,"product_id":7892599701603,"position":12,"created_at":"2026-07-20T16:33:07+08:00","updated_at":"2026-07-20T16:33:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2_45fdc1be-4c00-4a5d-bb39-b7cb43bcd5a8.webp?v=1784536389","variant_ids":[43756437995619]},"available":true,"name":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01085O8-AAR04","featured_media":{"alt":null,"id":27825894981731,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2_45fdc1be-4c00-4a5d-bb39-b7cb43bcd5a8.webp?v=1784536389"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216.webp?v=1759369442","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2.webp?v=1759369443","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6.webp?v=1759369444","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000.webp?v=1759369444","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a3c4d46e5f72066f3e4a70de1404460047c219d2.webp?v=1759369445","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d49f82c6f6bec1b28c1f93e14a92ea8c08947783.webp?v=1759369446","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44217d1b23eb7ba2d11b03b0c84d49175b74a297.webp?v=1759369447","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000_100f79d7-6208-48b9-b867-8579e4a6307e.webp?v=1784536372","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216_cf63f04c-64c3-40c7-a24f-d64aad59ac03.webp?v=1784536374","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d49f82c6f6bec1b28c1f93e14a92ea8c08947783_99b10f4e-31d0-43c7-baf6-bb97c57c9723.webp?v=1784536378","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6_072c7e86-d276-4854-8720-729c28cc7e40.webp?v=1784536384","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2_45fdc1be-4c00-4a5d-bb39-b7cb43bcd5a8.webp?v=1784536389"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216.webp?v=1759369442","options":["color"],"media":[{"alt":null,"id":26113238401123,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216.webp?v=1759369442"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216.webp?v=1759369442","width":2000},{"alt":null,"id":26113238564963,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2.webp?v=1759369443"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2.webp?v=1759369443","width":2000},{"alt":null,"id":26113238663267,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6.webp?v=1759369444"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6.webp?v=1759369444","width":2000},{"alt":null,"id":26113238761571,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000.webp?v=1759369444"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000.webp?v=1759369444","width":2000},{"alt":null,"id":26113238958179,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a3c4d46e5f72066f3e4a70de1404460047c219d2.webp?v=1759369445"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a3c4d46e5f72066f3e4a70de1404460047c219d2.webp?v=1759369445","width":2000},{"alt":null,"id":26113239122019,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d49f82c6f6bec1b28c1f93e14a92ea8c08947783.webp?v=1759369446"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d49f82c6f6bec1b28c1f93e14a92ea8c08947783.webp?v=1759369446","width":2000},{"alt":null,"id":26113239285859,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44217d1b23eb7ba2d11b03b0c84d49175b74a297.webp?v=1759369447"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44217d1b23eb7ba2d11b03b0c84d49175b74a297.webp?v=1759369447","width":2000},{"alt":null,"id":27825892524131,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000_100f79d7-6208-48b9-b867-8579e4a6307e.webp?v=1784536372"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000_100f79d7-6208-48b9-b867-8579e4a6307e.webp?v=1784536372","width":2000},{"alt":null,"id":27825892982883,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216_cf63f04c-64c3-40c7-a24f-d64aad59ac03.webp?v=1784536374"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216_cf63f04c-64c3-40c7-a24f-d64aad59ac03.webp?v=1784536374","width":2000},{"alt":null,"id":27825893605475,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d49f82c6f6bec1b28c1f93e14a92ea8c08947783_99b10f4e-31d0-43c7-baf6-bb97c57c9723.webp?v=1784536378"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d49f82c6f6bec1b28c1f93e14a92ea8c08947783_99b10f4e-31d0-43c7-baf6-bb97c57c9723.webp?v=1784536378","width":2000},{"alt":null,"id":27825894064227,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6_072c7e86-d276-4854-8720-729c28cc7e40.webp?v=1784536384"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6_072c7e86-d276-4854-8720-729c28cc7e40.webp?v=1784536384","width":2000},{"alt":null,"id":27825894981731,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2_45fdc1be-4c00-4a5d-bb39-b7cb43bcd5a8.webp?v=1784536389"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2_45fdc1be-4c00-4a5d-bb39-b7cb43bcd5a8.webp?v=1784536389","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43756437864547,"title":"White","option1":"White","option2":null,"option3":null,"sku":"SST0108553-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":36321982283875,"product_id":7892599701603,"position":11,"created_at":"2026-07-20T16:33:02+08:00","updated_at":"2026-07-20T16:33:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6_072c7e86-d276-4854-8720-729c28cc7e40.webp?v=1784536384","variant_ids":[43756437864547]},"available":true,"name":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang - White","public_title":"White","options":["White"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108553-AAR04","featured_media":{"alt":null,"id":27825894064227,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6_072c7e86-d276-4854-8720-729c28cc7e40.webp?v=1784536384"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756437930083,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"SST0108557-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":36321981169763,"product_id":7892599701603,"position":9,"created_at":"2026-07-20T16:32:52+08:00","updated_at":"2026-07-20T16:32:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216_cf63f04c-64c3-40c7-a24f-d64aad59ac03.webp?v=1784536374","variant_ids":[43756437930083]},"available":true,"name":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108557-AAR04","featured_media":{"alt":null,"id":27825892982883,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b8adf2703ca3cb91336c913c91f75e08576f216_cf63f04c-64c3-40c7-a24f-d64aad59ac03.webp?v=1784536374"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756437962851,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0108552-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":36321980743779,"product_id":7892599701603,"position":8,"created_at":"2026-07-20T16:32:49+08:00","updated_at":"2026-07-20T16:32:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000_100f79d7-6208-48b9-b867-8579e4a6307e.webp?v=1784536372","variant_ids":[43756437962851]},"available":true,"name":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108552-AAR04","featured_media":{"alt":null,"id":27825892524131,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a29f90e07b9b51faafcfa698a8b4da5e6586000_100f79d7-6208-48b9-b867-8579e4a6307e.webp?v=1784536372"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43756437995619,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01085O8-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":36321983201379,"product_id":7892599701603,"position":12,"created_at":"2026-07-20T16:33:07+08:00","updated_at":"2026-07-20T16:33:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2_45fdc1be-4c00-4a5d-bb39-b7cb43bcd5a8.webp?v=1784536389","variant_ids":[43756437995619]},"available":true,"name":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01085O8-AAR04","featured_media":{"alt":null,"id":27825894981731,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4239605aa91d99c00b6a393cb0a5c93a02e09ad2_45fdc1be-4c00-4a5d-bb39-b7cb43bcd5a8.webp?v=1784536389"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43756437864547,"title":"White","option1":"White","option2":null,"option3":null,"sku":"SST0108553-AAR04","requires_shipping":true,"taxable":true,"featured_image":{"id":36321982283875,"product_id":7892599701603,"position":11,"created_at":"2026-07-20T16:33:02+08:00","updated_at":"2026-07-20T16:33:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6_072c7e86-d276-4854-8720-729c28cc7e40.webp?v=1784536384","variant_ids":[43756437864547]},"available":true,"name":"iPhone XR SolidSuit Aaron Chang Yin\u0026Yang - White","public_title":"White","options":["White"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0108553-AAR04","featured_media":{"alt":null,"id":27825894064227,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cc267e3f3b4f767304d1651dc08dd239fd45f7b6_072c7e86-d276-4854-8720-729c28cc7e40.webp?v=1784536384"}},"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: "停產" }