$product = {"id":7920063021155,"title":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的營火晚會","handle":"iphone-15-plus-mod-nx-hd67","description":null,"published_at":"2025-11-13T10:00:58+08:00","created_at":"2025-11-10T10:01:26+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 15 Plus","merge","reseller-incrediville"],"price":90000,"price_min":90000,"price_max":90000,"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":43827710623843,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0129657-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786187280483,"product_id":7920063021155,"position":17,"created_at":"2025-11-11T09:46:38+08:00","updated_at":"2025-11-11T09:46:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1_6ddf7d7a-865a-446b-a5a6-0b6a3a23c92f.webp?v=1762825600","variant_ids":[43827710623843]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的營火晚會 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129657-HD67","featured_media":{"alt":null,"id":26351644246115,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1_6ddf7d7a-865a-446b-a5a6-0b6a3a23c92f.webp?v=1762825600"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827710754915,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0129624-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786186100835,"product_id":7920063021155,"position":12,"created_at":"2025-11-11T09:46:34+08:00","updated_at":"2025-11-11T09:46:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e_04f06fa2-9e9b-4b25-b52e-7628544b3746.webp?v=1762825596","variant_ids":[43827710754915]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的營火晚會 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129624-HD67","featured_media":{"alt":null,"id":26351643066467,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e_04f06fa2-9e9b-4b25-b52e-7628544b3746.webp?v=1762825596"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/309069ec555b3af75c0746e11863dca69036cf7c.webp?v=1762740092","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1.webp?v=1762740093","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e.webp?v=1762740094","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec08f384f425b87c7a32ba3b69362420ac177b20.webp?v=1762740094","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b6c1b1027f4b246fe9791f98c744fffa2839113.webp?v=1762740095","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69a1d81aef90944863b07ecd5dc6c24bc6ab4db9.webp?v=1762740096","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/050cd2775934f321c464a350dbbc11068416d2f2.webp?v=1762740096","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0b6fc6d0f42e48a721a2ee01f01c2f7c4ff1786a.webp?v=1762740097","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6595f795905c3991df1117c1e6ec01a55373750e.webp?v=1762740098","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/309069ec555b3af75c0746e11863dca69036cf7c_23de7295-3ffa-4606-9179-71281232058a.webp?v=1762825595","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69a1d81aef90944863b07ecd5dc6c24bc6ab4db9_d1a8facd-2092-4215-81b3-3bf91e0b8672.webp?v=1762825596","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e_04f06fa2-9e9b-4b25-b52e-7628544b3746.webp?v=1762825596","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b6c1b1027f4b246fe9791f98c744fffa2839113_dbd7e3f3-adf9-4676-8e53-c750049b7aea.webp?v=1762825597","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/050cd2775934f321c464a350dbbc11068416d2f2_fad93372-2e75-4161-8309-cb30538976c5.webp?v=1762825598","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0b6fc6d0f42e48a721a2ee01f01c2f7c4ff1786a_56569d70-99c1-4030-80ef-fbbc9e87f4eb.webp?v=1762825598","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6595f795905c3991df1117c1e6ec01a55373750e_9c3f83a4-b6b8-4782-a8a0-c51e4fcbf2fa.webp?v=1762825599","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1_6ddf7d7a-865a-446b-a5a6-0b6a3a23c92f.webp?v=1762825600","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec08f384f425b87c7a32ba3b69362420ac177b20_973e0a6e-d7e0-4c28-a8e6-886bfb3f6cba.webp?v=1762825600"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/309069ec555b3af75c0746e11863dca69036cf7c.webp?v=1762740092","options":["color"],"media":[{"alt":null,"id":26345857286243,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/309069ec555b3af75c0746e11863dca69036cf7c.webp?v=1762740092"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/309069ec555b3af75c0746e11863dca69036cf7c.webp?v=1762740092","width":2000},{"alt":null,"id":26345858433123,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1.webp?v=1762740093"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1.webp?v=1762740093","width":2000},{"alt":null,"id":26345859711075,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e.webp?v=1762740094"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e.webp?v=1762740094","width":2000},{"alt":null,"id":26345860530275,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec08f384f425b87c7a32ba3b69362420ac177b20.webp?v=1762740094"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec08f384f425b87c7a32ba3b69362420ac177b20.webp?v=1762740094","width":2000},{"alt":null,"id":26345861611619,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b6c1b1027f4b246fe9791f98c744fffa2839113.webp?v=1762740095"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b6c1b1027f4b246fe9791f98c744fffa2839113.webp?v=1762740095","width":2000},{"alt":null,"id":26345863020643,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69a1d81aef90944863b07ecd5dc6c24bc6ab4db9.webp?v=1762740096"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69a1d81aef90944863b07ecd5dc6c24bc6ab4db9.webp?v=1762740096","width":2000},{"alt":null,"id":26345863938147,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/050cd2775934f321c464a350dbbc11068416d2f2.webp?v=1762740096"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/050cd2775934f321c464a350dbbc11068416d2f2.webp?v=1762740096","width":2000},{"alt":null,"id":26345865150563,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0b6fc6d0f42e48a721a2ee01f01c2f7c4ff1786a.webp?v=1762740097"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0b6fc6d0f42e48a721a2ee01f01c2f7c4ff1786a.webp?v=1762740097","width":2000},{"alt":null,"id":26345866625123,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6595f795905c3991df1117c1e6ec01a55373750e.webp?v=1762740098"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6595f795905c3991df1117c1e6ec01a55373750e.webp?v=1762740098","width":2000},{"alt":null,"id":26351642673251,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/309069ec555b3af75c0746e11863dca69036cf7c_23de7295-3ffa-4606-9179-71281232058a.webp?v=1762825595"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/309069ec555b3af75c0746e11863dca69036cf7c_23de7295-3ffa-4606-9179-71281232058a.webp?v=1762825595","width":2000},{"alt":null,"id":26351642837091,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69a1d81aef90944863b07ecd5dc6c24bc6ab4db9_d1a8facd-2092-4215-81b3-3bf91e0b8672.webp?v=1762825596"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/69a1d81aef90944863b07ecd5dc6c24bc6ab4db9_d1a8facd-2092-4215-81b3-3bf91e0b8672.webp?v=1762825596","width":2000},{"alt":null,"id":26351643066467,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e_04f06fa2-9e9b-4b25-b52e-7628544b3746.webp?v=1762825596"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e_04f06fa2-9e9b-4b25-b52e-7628544b3746.webp?v=1762825596","width":2000},{"alt":null,"id":26351643263075,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b6c1b1027f4b246fe9791f98c744fffa2839113_dbd7e3f3-adf9-4676-8e53-c750049b7aea.webp?v=1762825597"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7b6c1b1027f4b246fe9791f98c744fffa2839113_dbd7e3f3-adf9-4676-8e53-c750049b7aea.webp?v=1762825597","width":2000},{"alt":null,"id":26351643557987,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/050cd2775934f321c464a350dbbc11068416d2f2_fad93372-2e75-4161-8309-cb30538976c5.webp?v=1762825598"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/050cd2775934f321c464a350dbbc11068416d2f2_fad93372-2e75-4161-8309-cb30538976c5.webp?v=1762825598","width":2000},{"alt":null,"id":26351643820131,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0b6fc6d0f42e48a721a2ee01f01c2f7c4ff1786a_56569d70-99c1-4030-80ef-fbbc9e87f4eb.webp?v=1762825598"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0b6fc6d0f42e48a721a2ee01f01c2f7c4ff1786a_56569d70-99c1-4030-80ef-fbbc9e87f4eb.webp?v=1762825598","width":2000},{"alt":null,"id":26351644082275,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6595f795905c3991df1117c1e6ec01a55373750e_9c3f83a4-b6b8-4782-a8a0-c51e4fcbf2fa.webp?v=1762825599"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6595f795905c3991df1117c1e6ec01a55373750e_9c3f83a4-b6b8-4782-a8a0-c51e4fcbf2fa.webp?v=1762825599","width":2000},{"alt":null,"id":26351644246115,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1_6ddf7d7a-865a-446b-a5a6-0b6a3a23c92f.webp?v=1762825600"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1_6ddf7d7a-865a-446b-a5a6-0b6a3a23c92f.webp?v=1762825600","width":2000},{"alt":null,"id":26351644508259,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec08f384f425b87c7a32ba3b69362420ac177b20_973e0a6e-d7e0-4c28-a8e6-886bfb3f6cba.webp?v=1762825600"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec08f384f425b87c7a32ba3b69362420ac177b20_973e0a6e-d7e0-4c28-a8e6-886bfb3f6cba.webp?v=1762825600","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43827710623843,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0129657-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786187280483,"product_id":7920063021155,"position":17,"created_at":"2025-11-11T09:46:38+08:00","updated_at":"2025-11-11T09:46:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1_6ddf7d7a-865a-446b-a5a6-0b6a3a23c92f.webp?v=1762825600","variant_ids":[43827710623843]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的營火晚會 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129657-HD67","featured_media":{"alt":null,"id":26351644246115,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1_6ddf7d7a-865a-446b-a5a6-0b6a3a23c92f.webp?v=1762825600"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827710754915,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0129624-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786186100835,"product_id":7920063021155,"position":12,"created_at":"2025-11-11T09:46:34+08:00","updated_at":"2025-11-11T09:46:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e_04f06fa2-9e9b-4b25-b52e-7628544b3746.webp?v=1762825596","variant_ids":[43827710754915]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的營火晚會 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129624-HD67","featured_media":{"alt":null,"id":26351643066467,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a498c88fee9409c2c4aa613f2687e04796d94e_04f06fa2-9e9b-4b25-b52e-7628544b3746.webp?v=1762825596"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43827710623843,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0129657-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786187280483,"product_id":7920063021155,"position":17,"created_at":"2025-11-11T09:46:38+08:00","updated_at":"2025-11-11T09:46:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1_6ddf7d7a-865a-446b-a5a6-0b6a3a23c92f.webp?v=1762825600","variant_ids":[43827710623843]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的營火晚會 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129657-HD67","featured_media":{"alt":null,"id":26351644246115,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38f2ae100c3c28499ff9b1d04a80b4de8617c4d1_6ddf7d7a-865a-446b-a5a6-0b6a3a23c92f.webp?v=1762825600"}},"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: "停產" }