$product = {"id":7823738404963,"title":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車","handle":"iphone-15-pro-max-solidx-pl20","description":null,"published_at":"2025-07-01T19:23:49+08:00","created_at":"2025-06-20T10:20:04+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-snoopy","device-iPhone 15 Pro Max","merge","reseller-snoopy"],"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":43472541417571,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582284955747,"product_id":7823738404963,"position":10,"created_at":"2026-04-02T16:17:35+08:00","updated_at":"2026-04-02T16:17:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64cc02879e053e2807c6eb316b60912379488b27.webp?v=1775117856","variant_ids":[43472541417571]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114904682595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64cc02879e053e2807c6eb316b60912379488b27.webp?v=1775117856"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472544825443,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582283841635,"product_id":7823738404963,"position":5,"created_at":"2026-04-02T16:17:32+08:00","updated_at":"2026-04-02T16:17:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd09692265b704133af9f6028d1ad4f2e94b9091.webp?v=1775117854","variant_ids":[43472544825443]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114903568483,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd09692265b704133af9f6028d1ad4f2e94b9091.webp?v=1775117854"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472544923747,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582283350115,"product_id":7823738404963,"position":3,"created_at":"2026-04-02T16:17:31+08:00","updated_at":"2026-04-02T16:17:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/990c69fcc2fd9b801c3e08aa1947de998358bfdc.webp?v=1775117853","variant_ids":[43472544923747]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114903076963,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/990c69fcc2fd9b801c3e08aa1947de998358bfdc.webp?v=1775117853"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472544956515,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582283612259,"product_id":7823738404963,"position":4,"created_at":"2026-04-02T16:17:31+08:00","updated_at":"2026-04-02T16:17:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21db06c7462d31cb74ad3edd7538bc7186c26fb4.webp?v=1775117853","variant_ids":[43472544956515]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114903339107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21db06c7462d31cb74ad3edd7538bc7186c26fb4.webp?v=1775117853"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43494403735651,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582284169315,"product_id":7823738404963,"position":6,"created_at":"2026-04-02T16:17:32+08:00","updated_at":"2026-04-02T16:17:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7e0db9a2aa530276430a10eb112531f5dd6ea65.webp?v=1775117854","variant_ids":[43494403735651]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114903896163,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7e0db9a2aa530276430a10eb112531f5dd6ea65.webp?v=1775117854"}},"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-PL20.png?v=1750386007","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-PL20_8a9c3d32-9945-432b-a312-df4266bd1171.png?v=1750832183","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/990c69fcc2fd9b801c3e08aa1947de998358bfdc.webp?v=1775117853","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21db06c7462d31cb74ad3edd7538bc7186c26fb4.webp?v=1775117853","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd09692265b704133af9f6028d1ad4f2e94b9091.webp?v=1775117854","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7e0db9a2aa530276430a10eb112531f5dd6ea65.webp?v=1775117854","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b9de63732b31d906c5ac48529ba7769a6382c9d.webp?v=1775117855","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/187f0c40be8d179b96a726b5a9a7e678a1120170.webp?v=1775117856","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d429bb91399f50800b1445c6661416b9bbd9bfc.webp?v=1775117856","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64cc02879e053e2807c6eb316b60912379488b27.webp?v=1775117856","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5c83e154bdfd2040f58051d067a352a5eb85db9.webp?v=1775117858"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-PL20.png?v=1750386007","options":["color"],"media":[{"alt":null,"id":25720290115683,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-PL20.png?v=1750386007"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-PL20.png?v=1750386007","width":2000},{"alt":null,"id":25736351318115,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-PL20_8a9c3d32-9945-432b-a312-df4266bd1171.png?v=1750832183"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-PL20_8a9c3d32-9945-432b-a312-df4266bd1171.png?v=1750832183","width":2000},{"alt":null,"id":27114903076963,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/990c69fcc2fd9b801c3e08aa1947de998358bfdc.webp?v=1775117853"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/990c69fcc2fd9b801c3e08aa1947de998358bfdc.webp?v=1775117853","width":2000},{"alt":null,"id":27114903339107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21db06c7462d31cb74ad3edd7538bc7186c26fb4.webp?v=1775117853"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21db06c7462d31cb74ad3edd7538bc7186c26fb4.webp?v=1775117853","width":2000},{"alt":null,"id":27114903568483,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd09692265b704133af9f6028d1ad4f2e94b9091.webp?v=1775117854"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd09692265b704133af9f6028d1ad4f2e94b9091.webp?v=1775117854","width":2000},{"alt":null,"id":27114903896163,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7e0db9a2aa530276430a10eb112531f5dd6ea65.webp?v=1775117854"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7e0db9a2aa530276430a10eb112531f5dd6ea65.webp?v=1775117854","width":2000},{"alt":null,"id":27114904125539,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b9de63732b31d906c5ac48529ba7769a6382c9d.webp?v=1775117855"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b9de63732b31d906c5ac48529ba7769a6382c9d.webp?v=1775117855","width":2000},{"alt":null,"id":27114904289379,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/187f0c40be8d179b96a726b5a9a7e678a1120170.webp?v=1775117856"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/187f0c40be8d179b96a726b5a9a7e678a1120170.webp?v=1775117856","width":2000},{"alt":null,"id":27114904551523,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d429bb91399f50800b1445c6661416b9bbd9bfc.webp?v=1775117856"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d429bb91399f50800b1445c6661416b9bbd9bfc.webp?v=1775117856","width":2000},{"alt":null,"id":27114904682595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64cc02879e053e2807c6eb316b60912379488b27.webp?v=1775117856"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64cc02879e053e2807c6eb316b60912379488b27.webp?v=1775117856","width":2000},{"alt":null,"id":27114904748131,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5c83e154bdfd2040f58051d067a352a5eb85db9.webp?v=1775117858"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5c83e154bdfd2040f58051d067a352a5eb85db9.webp?v=1775117858","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43472541417571,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582284955747,"product_id":7823738404963,"position":10,"created_at":"2026-04-02T16:17:35+08:00","updated_at":"2026-04-02T16:17:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64cc02879e053e2807c6eb316b60912379488b27.webp?v=1775117856","variant_ids":[43472541417571]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114904682595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64cc02879e053e2807c6eb316b60912379488b27.webp?v=1775117856"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472544825443,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582283841635,"product_id":7823738404963,"position":5,"created_at":"2026-04-02T16:17:32+08:00","updated_at":"2026-04-02T16:17:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd09692265b704133af9f6028d1ad4f2e94b9091.webp?v=1775117854","variant_ids":[43472544825443]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114903568483,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd09692265b704133af9f6028d1ad4f2e94b9091.webp?v=1775117854"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472544923747,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582283350115,"product_id":7823738404963,"position":3,"created_at":"2026-04-02T16:17:31+08:00","updated_at":"2026-04-02T16:17:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/990c69fcc2fd9b801c3e08aa1947de998358bfdc.webp?v=1775117853","variant_ids":[43472544923747]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114903076963,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/990c69fcc2fd9b801c3e08aa1947de998358bfdc.webp?v=1775117853"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472544956515,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582283612259,"product_id":7823738404963,"position":4,"created_at":"2026-04-02T16:17:31+08:00","updated_at":"2026-04-02T16:17:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21db06c7462d31cb74ad3edd7538bc7186c26fb4.webp?v=1775117853","variant_ids":[43472544956515]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114903339107,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/21db06c7462d31cb74ad3edd7538bc7186c26fb4.webp?v=1775117853"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43494403735651,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582284169315,"product_id":7823738404963,"position":6,"created_at":"2026-04-02T16:17:32+08:00","updated_at":"2026-04-02T16:17:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7e0db9a2aa530276430a10eb112531f5dd6ea65.webp?v=1775117854","variant_ids":[43494403735651]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114903896163,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7e0db9a2aa530276430a10eb112531f5dd6ea65.webp?v=1775117854"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43472541417571,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-PL20","requires_shipping":true,"taxable":true,"featured_image":{"id":35582284955747,"product_id":7823738404963,"position":10,"created_at":"2026-04-02T16:17:35+08:00","updated_at":"2026-04-02T16:17:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64cc02879e053e2807c6eb316b60912379488b27.webp?v=1775117856","variant_ids":[43472541417571]},"available":true,"name":"iPhone 15 Pro Max SolidX Snoopy 史努比 騎腳踏車 - 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-PL20","featured_media":{"alt":null,"id":27114904682595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64cc02879e053e2807c6eb316b60912379488b27.webp?v=1775117856"}},"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: "停產" }