$product = {"id":7823808397411,"title":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫","handle":"iphone-15-pro-max-solidx-ei10","description":null,"published_at":"2025-07-01T19:13:26+08:00","created_at":"2025-06-20T10:27:42+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-darylhochi","device-iPhone 15 Pro Max","merge","reseller-darylhochi"],"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":43473238392931,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581970317411,"product_id":7823808397411,"position":11,"created_at":"2026-04-02T15:58:19+08:00","updated_at":"2026-04-02T15:58:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/141c1dab21ac987b97786a2a0207403e0c849550.webp?v=1775116701","variant_ids":[43473238392931]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114590175331,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/141c1dab21ac987b97786a2a0207403e0c849550.webp?v=1775116701"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473240916067,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581969301603,"product_id":7823808397411,"position":7,"created_at":"2026-04-02T15:58:17+08:00","updated_at":"2026-04-02T15:58:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0ade7560841888a4d027ed50875c32a17e11d92.webp?v=1775116699","variant_ids":[43473240916067]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114589159523,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0ade7560841888a4d027ed50875c32a17e11d92.webp?v=1775116699"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473241014371,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581968908387,"product_id":7823808397411,"position":5,"created_at":"2026-04-02T15:58:16+08:00","updated_at":"2026-04-02T15:58:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d7c46c7084494ef45bd0fa3554ebe6e92a3ce1.webp?v=1775116698","variant_ids":[43473241014371]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114588766307,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d7c46c7084494ef45bd0fa3554ebe6e92a3ce1.webp?v=1775116698"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473241047139,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581969825891,"product_id":7823808397411,"position":9,"created_at":"2026-04-02T15:58:18+08:00","updated_at":"2026-04-02T15:58:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e5c52196004a1d740c425ac9f0d8887e9dea123.webp?v=1775116700","variant_ids":[43473241047139]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114589683811,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e5c52196004a1d740c425ac9f0d8887e9dea123.webp?v=1775116700"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43493992366179,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581969104995,"product_id":7823808397411,"position":6,"created_at":"2026-04-02T15:58:16+08:00","updated_at":"2026-04-02T15:58:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dad65f301bb65563ce647b70a3cb6b77d78765fd.webp?v=1775116698","variant_ids":[43493992366179]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114588962915,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dad65f301bb65563ce647b70a3cb6b77d78765fd.webp?v=1775116698"}},"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-EI10.png?v=1750386464","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-EI10_8fa07799-5d3a-44b0-bfdf-faac3ceaccf6.png?v=1750831301","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36295c6df93c43fab8471248c2f088f6088b612a.webp?v=1775116697","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c3f15a2f1a759384d81ef5ab83a0f994bd3cb7d.webp?v=1775116697","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d7c46c7084494ef45bd0fa3554ebe6e92a3ce1.webp?v=1775116698","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dad65f301bb65563ce647b70a3cb6b77d78765fd.webp?v=1775116698","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0ade7560841888a4d027ed50875c32a17e11d92.webp?v=1775116699","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73d414a453d3055e0bf43ea11e8a64268b78e7e7.webp?v=1775116700","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e5c52196004a1d740c425ac9f0d8887e9dea123.webp?v=1775116700","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e0d1b8724dd9540309f9574efe54f59a8ca3fcbe.webp?v=1775116701","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/141c1dab21ac987b97786a2a0207403e0c849550.webp?v=1775116701"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-EI10.png?v=1750386464","options":["color"],"media":[{"alt":null,"id":25720372527203,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-EI10.png?v=1750386464"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-EI10.png?v=1750386464","width":2000},{"alt":null,"id":25736162279523,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-EI10_8fa07799-5d3a-44b0-bfdf-faac3ceaccf6.png?v=1750831301"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-EI10_8fa07799-5d3a-44b0-bfdf-faac3ceaccf6.png?v=1750831301","width":2000},{"alt":null,"id":27114588471395,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36295c6df93c43fab8471248c2f088f6088b612a.webp?v=1775116697"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36295c6df93c43fab8471248c2f088f6088b612a.webp?v=1775116697","width":2000},{"alt":null,"id":27114588668003,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c3f15a2f1a759384d81ef5ab83a0f994bd3cb7d.webp?v=1775116697"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c3f15a2f1a759384d81ef5ab83a0f994bd3cb7d.webp?v=1775116697","width":2000},{"alt":null,"id":27114588766307,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d7c46c7084494ef45bd0fa3554ebe6e92a3ce1.webp?v=1775116698"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d7c46c7084494ef45bd0fa3554ebe6e92a3ce1.webp?v=1775116698","width":2000},{"alt":null,"id":27114588962915,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dad65f301bb65563ce647b70a3cb6b77d78765fd.webp?v=1775116698"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dad65f301bb65563ce647b70a3cb6b77d78765fd.webp?v=1775116698","width":2000},{"alt":null,"id":27114589159523,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0ade7560841888a4d027ed50875c32a17e11d92.webp?v=1775116699"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0ade7560841888a4d027ed50875c32a17e11d92.webp?v=1775116699","width":2000},{"alt":null,"id":27114589388899,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73d414a453d3055e0bf43ea11e8a64268b78e7e7.webp?v=1775116700"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73d414a453d3055e0bf43ea11e8a64268b78e7e7.webp?v=1775116700","width":2000},{"alt":null,"id":27114589683811,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e5c52196004a1d740c425ac9f0d8887e9dea123.webp?v=1775116700"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e5c52196004a1d740c425ac9f0d8887e9dea123.webp?v=1775116700","width":2000},{"alt":null,"id":27114589913187,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e0d1b8724dd9540309f9574efe54f59a8ca3fcbe.webp?v=1775116701"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e0d1b8724dd9540309f9574efe54f59a8ca3fcbe.webp?v=1775116701","width":2000},{"alt":null,"id":27114590175331,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/141c1dab21ac987b97786a2a0207403e0c849550.webp?v=1775116701"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/141c1dab21ac987b97786a2a0207403e0c849550.webp?v=1775116701","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43473238392931,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581970317411,"product_id":7823808397411,"position":11,"created_at":"2026-04-02T15:58:19+08:00","updated_at":"2026-04-02T15:58:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/141c1dab21ac987b97786a2a0207403e0c849550.webp?v=1775116701","variant_ids":[43473238392931]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114590175331,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/141c1dab21ac987b97786a2a0207403e0c849550.webp?v=1775116701"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473240916067,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581969301603,"product_id":7823808397411,"position":7,"created_at":"2026-04-02T15:58:17+08:00","updated_at":"2026-04-02T15:58:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0ade7560841888a4d027ed50875c32a17e11d92.webp?v=1775116699","variant_ids":[43473240916067]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114589159523,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0ade7560841888a4d027ed50875c32a17e11d92.webp?v=1775116699"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473241014371,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581968908387,"product_id":7823808397411,"position":5,"created_at":"2026-04-02T15:58:16+08:00","updated_at":"2026-04-02T15:58:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d7c46c7084494ef45bd0fa3554ebe6e92a3ce1.webp?v=1775116698","variant_ids":[43473241014371]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114588766307,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c0d7c46c7084494ef45bd0fa3554ebe6e92a3ce1.webp?v=1775116698"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43473241047139,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581969825891,"product_id":7823808397411,"position":9,"created_at":"2026-04-02T15:58:18+08:00","updated_at":"2026-04-02T15:58:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e5c52196004a1d740c425ac9f0d8887e9dea123.webp?v=1775116700","variant_ids":[43473241047139]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114589683811,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e5c52196004a1d740c425ac9f0d8887e9dea123.webp?v=1775116700"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43493992366179,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581969104995,"product_id":7823808397411,"position":6,"created_at":"2026-04-02T15:58:16+08:00","updated_at":"2026-04-02T15:58:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dad65f301bb65563ce647b70a3cb6b77d78765fd.webp?v=1775116698","variant_ids":[43493992366179]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114588962915,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dad65f301bb65563ce647b70a3cb6b77d78765fd.webp?v=1775116698"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43473238392931,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-EI10","requires_shipping":true,"taxable":true,"featured_image":{"id":35581970317411,"product_id":7823808397411,"position":11,"created_at":"2026-04-02T15:58:19+08:00","updated_at":"2026-04-02T15:58:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/141c1dab21ac987b97786a2a0207403e0c849550.webp?v=1775116701","variant_ids":[43473238392931]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi 到處畫 - 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-EI10","featured_media":{"alt":null,"id":27114590175331,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/141c1dab21ac987b97786a2a0207403e0c849550.webp?v=1775116701"}},"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: "停產" }