$product = {"id":7888983392355,"title":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art","handle":"iphone-13-mini-solidsuit-classic-tb30","description":null,"published_at":"2025-09-24T11:07:14+08:00","created_at":"2025-09-23T12:14:03+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-oracle-redbull-racing","device-iPhone 13 Mini","merge","reseller-oracle-redbull-racing"],"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":43744939180131,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"SST01228Z9-TB30","requires_shipping":true,"taxable":true,"featured_image":{"id":36153664700515,"product_id":7888983392355,"position":11,"created_at":"2026-07-02T14:55:22+08:00","updated_at":"2026-07-02T14:55:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74_1171260a-0a52-4e02-bd9b-03a21d32e925.webp?v=1782975324","variant_ids":[43744939180131]},"available":true,"name":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z9-TB30","featured_media":{"alt":null,"id":27658537762915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74_1171260a-0a52-4e02-bd9b-03a21d32e925.webp?v=1782975324"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744939245667,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0122852-TB30","requires_shipping":true,"taxable":true,"featured_image":{"id":36153664372835,"product_id":7888983392355,"position":10,"created_at":"2026-07-02T14:55:21+08:00","updated_at":"2026-07-02T14:55:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c_6776218f-3c49-487f-adf5-3a057e7fc16a.webp?v=1782975323","variant_ids":[43744939245667]},"available":true,"name":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0122852-TB30","featured_media":{"alt":null,"id":27658537435235,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c_6776218f-3c49-487f-adf5-3a057e7fc16a.webp?v=1782975323"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744939278435,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01228O8-TB30","requires_shipping":true,"taxable":true,"featured_image":{"id":36153664798819,"product_id":7888983392355,"position":12,"created_at":"2026-07-02T14:55:23+08:00","updated_at":"2026-07-02T14:55:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef_67e49233-3a3e-4fae-a079-845c8541a9df.webp?v=1782975325","variant_ids":[43744939278435]},"available":true,"name":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art - 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":"SST01228O8-TB30","featured_media":{"alt":null,"id":27658537861219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef_67e49233-3a3e-4fae-a079-845c8541a9df.webp?v=1782975325"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744939311203,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"SST01228Z8-TB30","requires_shipping":true,"taxable":true,"featured_image":{"id":36153663946851,"product_id":7888983392355,"position":9,"created_at":"2026-07-02T14:55:21+08:00","updated_at":"2026-07-02T14:55:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5_f62b82ff-b92d-4193-a1f6-b690bd9cae07.webp?v=1782975323","variant_ids":[43744939311203]},"available":true,"name":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z8-TB30","featured_media":{"alt":null,"id":27658537009251,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5_f62b82ff-b92d-4193-a1f6-b690bd9cae07.webp?v=1782975323"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/615dce6fd3e1c5e5080f042c093741e3cae85141.webp?v=1758600851","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f33d416f304eaec6076697bb7e538277b078fe44.webp?v=1758600851","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74.webp?v=1758600851","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c.webp?v=1758600852","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef.webp?v=1758600853","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9993f5cb503e57aef1c5479e0484b022f9c58ec8.webp?v=1758600853","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ed637556b7ae2b224bf68b07fea025282e056d2.webp?v=1758600854","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5.webp?v=1758600854","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5_f62b82ff-b92d-4193-a1f6-b690bd9cae07.webp?v=1782975323","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c_6776218f-3c49-487f-adf5-3a057e7fc16a.webp?v=1782975323","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74_1171260a-0a52-4e02-bd9b-03a21d32e925.webp?v=1782975324","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef_67e49233-3a3e-4fae-a079-845c8541a9df.webp?v=1782975325"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/615dce6fd3e1c5e5080f042c093741e3cae85141.webp?v=1758600851","options":["color"],"media":[{"alt":null,"id":26088884928611,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/615dce6fd3e1c5e5080f042c093741e3cae85141.webp?v=1758600851"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/615dce6fd3e1c5e5080f042c093741e3cae85141.webp?v=1758600851","width":2000},{"alt":null,"id":26088885125219,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f33d416f304eaec6076697bb7e538277b078fe44.webp?v=1758600851"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f33d416f304eaec6076697bb7e538277b078fe44.webp?v=1758600851","width":2000},{"alt":null,"id":26088885321827,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74.webp?v=1758600851"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74.webp?v=1758600851","width":2000},{"alt":null,"id":26088885485667,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c.webp?v=1758600852"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c.webp?v=1758600852","width":2000},{"alt":null,"id":26088885649507,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef.webp?v=1758600853"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef.webp?v=1758600853","width":2000},{"alt":null,"id":26088885747811,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9993f5cb503e57aef1c5479e0484b022f9c58ec8.webp?v=1758600853"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9993f5cb503e57aef1c5479e0484b022f9c58ec8.webp?v=1758600853","width":2000},{"alt":null,"id":26088885780579,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ed637556b7ae2b224bf68b07fea025282e056d2.webp?v=1758600854"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ed637556b7ae2b224bf68b07fea025282e056d2.webp?v=1758600854","width":2000},{"alt":null,"id":26088885911651,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5.webp?v=1758600854"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5.webp?v=1758600854","width":2000},{"alt":null,"id":27658537009251,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5_f62b82ff-b92d-4193-a1f6-b690bd9cae07.webp?v=1782975323"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5_f62b82ff-b92d-4193-a1f6-b690bd9cae07.webp?v=1782975323","width":2000},{"alt":null,"id":27658537435235,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c_6776218f-3c49-487f-adf5-3a057e7fc16a.webp?v=1782975323"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c_6776218f-3c49-487f-adf5-3a057e7fc16a.webp?v=1782975323","width":2000},{"alt":null,"id":27658537762915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74_1171260a-0a52-4e02-bd9b-03a21d32e925.webp?v=1782975324"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74_1171260a-0a52-4e02-bd9b-03a21d32e925.webp?v=1782975324","width":2000},{"alt":null,"id":27658537861219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef_67e49233-3a3e-4fae-a079-845c8541a9df.webp?v=1782975325"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef_67e49233-3a3e-4fae-a079-845c8541a9df.webp?v=1782975325","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43744939180131,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"SST01228Z9-TB30","requires_shipping":true,"taxable":true,"featured_image":{"id":36153664700515,"product_id":7888983392355,"position":11,"created_at":"2026-07-02T14:55:22+08:00","updated_at":"2026-07-02T14:55:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74_1171260a-0a52-4e02-bd9b-03a21d32e925.webp?v=1782975324","variant_ids":[43744939180131]},"available":true,"name":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z9-TB30","featured_media":{"alt":null,"id":27658537762915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74_1171260a-0a52-4e02-bd9b-03a21d32e925.webp?v=1782975324"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744939245667,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0122852-TB30","requires_shipping":true,"taxable":true,"featured_image":{"id":36153664372835,"product_id":7888983392355,"position":10,"created_at":"2026-07-02T14:55:21+08:00","updated_at":"2026-07-02T14:55:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c_6776218f-3c49-487f-adf5-3a057e7fc16a.webp?v=1782975323","variant_ids":[43744939245667]},"available":true,"name":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0122852-TB30","featured_media":{"alt":null,"id":27658537435235,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddfcaaba04ca34a473f22b30a921ffa86ea17f0c_6776218f-3c49-487f-adf5-3a057e7fc16a.webp?v=1782975323"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744939278435,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01228O8-TB30","requires_shipping":true,"taxable":true,"featured_image":{"id":36153664798819,"product_id":7888983392355,"position":12,"created_at":"2026-07-02T14:55:23+08:00","updated_at":"2026-07-02T14:55:25+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef_67e49233-3a3e-4fae-a079-845c8541a9df.webp?v=1782975325","variant_ids":[43744939278435]},"available":true,"name":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art - 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":"SST01228O8-TB30","featured_media":{"alt":null,"id":27658537861219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be2aa545feb199bec325af243c812d3a93f77eef_67e49233-3a3e-4fae-a079-845c8541a9df.webp?v=1782975325"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744939311203,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"SST01228Z8-TB30","requires_shipping":true,"taxable":true,"featured_image":{"id":36153663946851,"product_id":7888983392355,"position":9,"created_at":"2026-07-02T14:55:21+08:00","updated_at":"2026-07-02T14:55:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5_f62b82ff-b92d-4193-a1f6-b690bd9cae07.webp?v=1782975323","variant_ids":[43744939311203]},"available":true,"name":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z8-TB30","featured_media":{"alt":null,"id":27658537009251,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c64f241061d52228708ffc0f3540e0db963e0e5_f62b82ff-b92d-4193-a1f6-b690bd9cae07.webp?v=1782975323"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43744939180131,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"SST01228Z9-TB30","requires_shipping":true,"taxable":true,"featured_image":{"id":36153664700515,"product_id":7888983392355,"position":11,"created_at":"2026-07-02T14:55:22+08:00","updated_at":"2026-07-02T14:55:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74_1171260a-0a52-4e02-bd9b-03a21d32e925.webp?v=1782975324","variant_ids":[43744939180131]},"available":true,"name":"iPhone 13 mini SolidSuit Oracle Red Bull Racing MV1 - Pixel Art - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z9-TB30","featured_media":{"alt":null,"id":27658537762915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a68ce473400d793124a2143d53f63d577cfdd74_1171260a-0a52-4e02-bd9b-03a21d32e925.webp?v=1782975324"}},"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: "停產" }