$product = {"id":7823829139555,"title":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉","handle":"iphone-15-pro-max-solidx-it06","description":null,"published_at":"2025-07-01T19:10:31+08:00","created_at":"2025-06-20T10:30:01+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-godgwawa","device-iPhone 15 Pro Max","merge","reseller-godgwawa"],"price":125000,"price_min":125000,"price_max":125000,"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":43473445322851,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628658275,"product_id":7823829139555,"position":7,"created_at":"2026-03-09T11:35:37+08:00","updated_at":"2026-03-09T11:35:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b578b9c731eb990d97049090fbc44d426d1978e.webp?v=1773027339","variant_ids":[43473445322851]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-IT06","featured_media":{"alt":null,"id":26958807203939,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b578b9c731eb990d97049090fbc44d426d1978e.webp?v=1773027339"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473448173667,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416627708003,"product_id":7823829139555,"position":4,"created_at":"2026-03-09T11:35:36+08:00","updated_at":"2026-03-09T11:35:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dea917b5d5c072679da06625be3f16dbf6ad5e94.webp?v=1773027340","variant_ids":[43473448173667]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-IT06","featured_media":{"alt":null,"id":26958806253667,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dea917b5d5c072679da06625be3f16dbf6ad5e94.webp?v=1773027340"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473448271971,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416629313635,"product_id":7823829139555,"position":9,"created_at":"2026-03-09T11:35:39+08:00","updated_at":"2026-03-09T11:35:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dcbff0aba04e46ebb5ba8bc76471c7e79a81013.webp?v=1773027340","variant_ids":[43473448271971]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-IT06","featured_media":{"alt":null,"id":26958807859299,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dcbff0aba04e46ebb5ba8bc76471c7e79a81013.webp?v=1773027340"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473448304739,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628330595,"product_id":7823829139555,"position":6,"created_at":"2026-03-09T11:35:37+08:00","updated_at":"2026-03-09T11:35:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c2f59bdc8a0d7a86b651f08e495c3516e0a8aef.webp?v=1773027339","variant_ids":[43473448304739]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-IT06","featured_media":{"alt":null,"id":26958806909027,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c2f59bdc8a0d7a86b651f08e495c3516e0a8aef.webp?v=1773027339"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43494148145251,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416630100067,"product_id":7823829139555,"position":11,"created_at":"2026-03-09T11:35:40+08:00","updated_at":"2026-03-09T11:35:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4d0631519213881d4ac468238c5f0820367ccb8.webp?v=1773027342","variant_ids":[43494148145251]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-IT06","featured_media":{"alt":null,"id":26958808645731,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4d0631519213881d4ac468238c5f0820367ccb8.webp?v=1773027342"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-IT06_567937f6-e5e0-471b-bf31-4e05cdb5d13e.png?v=1750386604","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-IT06_445c81cb-bebb-456b-aff5-93194a82047c.png?v=1750831683","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d4dd737c95882104700b6d86c5e67a4226b8cce.webp?v=1773027337","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dea917b5d5c072679da06625be3f16dbf6ad5e94.webp?v=1773027340","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/436de23865b403638e8bf474421a6d782048399a.webp?v=1773027338","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c2f59bdc8a0d7a86b651f08e495c3516e0a8aef.webp?v=1773027339","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b578b9c731eb990d97049090fbc44d426d1978e.webp?v=1773027339","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0786de874f1de9d21fd845c108c7f7adb422ce48.webp?v=1773027340","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dcbff0aba04e46ebb5ba8bc76471c7e79a81013.webp?v=1773027340","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b715d69130e7bfc8653aa892b90c1a419d973725.webp?v=1773027341","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4d0631519213881d4ac468238c5f0820367ccb8.webp?v=1773027342"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-IT06_567937f6-e5e0-471b-bf31-4e05cdb5d13e.png?v=1750386604","options":["color"],"media":[{"alt":null,"id":25720396152931,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-IT06_567937f6-e5e0-471b-bf31-4e05cdb5d13e.png?v=1750386604"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-IT06_567937f6-e5e0-471b-bf31-4e05cdb5d13e.png?v=1750386604","width":2000},{"alt":null,"id":25736237580387,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-IT06_445c81cb-bebb-456b-aff5-93194a82047c.png?v=1750831683"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-IT06_445c81cb-bebb-456b-aff5-93194a82047c.png?v=1750831683","width":2000},{"alt":null,"id":26958806024291,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d4dd737c95882104700b6d86c5e67a4226b8cce.webp?v=1773027337"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d4dd737c95882104700b6d86c5e67a4226b8cce.webp?v=1773027337","width":2000},{"alt":null,"id":26958806253667,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dea917b5d5c072679da06625be3f16dbf6ad5e94.webp?v=1773027340"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dea917b5d5c072679da06625be3f16dbf6ad5e94.webp?v=1773027340","width":2000},{"alt":null,"id":26958806581347,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/436de23865b403638e8bf474421a6d782048399a.webp?v=1773027338"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/436de23865b403638e8bf474421a6d782048399a.webp?v=1773027338","width":2000},{"alt":null,"id":26958806909027,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c2f59bdc8a0d7a86b651f08e495c3516e0a8aef.webp?v=1773027339"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c2f59bdc8a0d7a86b651f08e495c3516e0a8aef.webp?v=1773027339","width":2000},{"alt":null,"id":26958807203939,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b578b9c731eb990d97049090fbc44d426d1978e.webp?v=1773027339"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b578b9c731eb990d97049090fbc44d426d1978e.webp?v=1773027339","width":2000},{"alt":null,"id":26958807531619,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0786de874f1de9d21fd845c108c7f7adb422ce48.webp?v=1773027340"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0786de874f1de9d21fd845c108c7f7adb422ce48.webp?v=1773027340","width":2000},{"alt":null,"id":26958807859299,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dcbff0aba04e46ebb5ba8bc76471c7e79a81013.webp?v=1773027340"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dcbff0aba04e46ebb5ba8bc76471c7e79a81013.webp?v=1773027340","width":2000},{"alt":null,"id":26958808252515,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b715d69130e7bfc8653aa892b90c1a419d973725.webp?v=1773027341"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b715d69130e7bfc8653aa892b90c1a419d973725.webp?v=1773027341","width":2000},{"alt":null,"id":26958808645731,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4d0631519213881d4ac468238c5f0820367ccb8.webp?v=1773027342"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4d0631519213881d4ac468238c5f0820367ccb8.webp?v=1773027342","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43473445322851,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628658275,"product_id":7823829139555,"position":7,"created_at":"2026-03-09T11:35:37+08:00","updated_at":"2026-03-09T11:35:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b578b9c731eb990d97049090fbc44d426d1978e.webp?v=1773027339","variant_ids":[43473445322851]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-IT06","featured_media":{"alt":null,"id":26958807203939,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b578b9c731eb990d97049090fbc44d426d1978e.webp?v=1773027339"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473448173667,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416627708003,"product_id":7823829139555,"position":4,"created_at":"2026-03-09T11:35:36+08:00","updated_at":"2026-03-09T11:35:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dea917b5d5c072679da06625be3f16dbf6ad5e94.webp?v=1773027340","variant_ids":[43473448173667]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-IT06","featured_media":{"alt":null,"id":26958806253667,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dea917b5d5c072679da06625be3f16dbf6ad5e94.webp?v=1773027340"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473448271971,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416629313635,"product_id":7823829139555,"position":9,"created_at":"2026-03-09T11:35:39+08:00","updated_at":"2026-03-09T11:35:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dcbff0aba04e46ebb5ba8bc76471c7e79a81013.webp?v=1773027340","variant_ids":[43473448271971]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-IT06","featured_media":{"alt":null,"id":26958807859299,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dcbff0aba04e46ebb5ba8bc76471c7e79a81013.webp?v=1773027340"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473448304739,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628330595,"product_id":7823829139555,"position":6,"created_at":"2026-03-09T11:35:37+08:00","updated_at":"2026-03-09T11:35:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c2f59bdc8a0d7a86b651f08e495c3516e0a8aef.webp?v=1773027339","variant_ids":[43473448304739]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-IT06","featured_media":{"alt":null,"id":26958806909027,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c2f59bdc8a0d7a86b651f08e495c3516e0a8aef.webp?v=1773027339"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43494148145251,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416630100067,"product_id":7823829139555,"position":11,"created_at":"2026-03-09T11:35:40+08:00","updated_at":"2026-03-09T11:35:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4d0631519213881d4ac468238c5f0820367ccb8.webp?v=1773027342","variant_ids":[43494148145251]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-IT06","featured_media":{"alt":null,"id":26958808645731,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e4d0631519213881d4ac468238c5f0820367ccb8.webp?v=1773027342"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43473445322851,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IT06","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628658275,"product_id":7823829139555,"position":7,"created_at":"2026-03-09T11:35:37+08:00","updated_at":"2026-03-09T11:35:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b578b9c731eb990d97049090fbc44d426d1978e.webp?v=1773027339","variant_ids":[43473445322851]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 拍貼吉 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-IT06","featured_media":{"alt":null,"id":26958807203939,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b578b9c731eb990d97049090fbc44d426d1978e.webp?v=1773027339"}},"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: "停產" }