$product = {"id":7920131866723,"title":"iPhone 12 mini Mod NX Incrediville 怪奇事物所 所長的營火晚會","handle":"iphone-12-mini-mod-nx-hd67","description":null,"published_at":"2025-11-13T09:59:06+08:00","created_at":"2025-11-10T10:04:27+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 12 Mini","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":43827805487203,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118424-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786205270115,"product_id":7920131866723,"position":20,"created_at":"2025-11-11T09:47:32+08:00","updated_at":"2025-11-11T09:47:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1_dd53916b-5471-47cc-948a-668428d76960.webp?v=1762825655","variant_ids":[43827805487203]},"available":true,"name":"iPhone 12 mini 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":"NPB0118424-HD67","featured_media":{"alt":null,"id":26351662202979,"position":20,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1_dd53916b-5471-47cc-948a-668428d76960.webp?v=1762825655"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cfc8bd204c14cfe915a15908c09127064a9a30a.webp?v=1762740273","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c74ab188eb31294bbb570fb6a5f191dc0d377ab8.webp?v=1762740273","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ffb6ecaeea30b4aac40ab8dd66b3a8f1688191e.webp?v=1762740274","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6705c03c7c3069ebeace506f225df5a02350d579.webp?v=1762740275","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/885bc3f3238eddc620e63b008bf1b1593dfb16da.webp?v=1762740275","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1.webp?v=1762740276","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23d76080720526dfb9f740b9956d10e325e624e6.webp?v=1762740277","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60b57a59570ab1c232ebe01962d00cee34a6d2d4.webp?v=1762740277","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48b66e947be5f0dad17c910576f53e4dd9c1a8a1.webp?v=1762740278","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/131384060898a65e7fe9aee9034bc243c507f9f0.webp?v=1762740279","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67974e0a1e5f71202d6173ff622d5205fdc24ccc.webp?v=1762740279","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/131384060898a65e7fe9aee9034bc243c507f9f0_74391bc9-5f57-431f-a2ff-cbbd1d5e962c.webp?v=1762825648","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60b57a59570ab1c232ebe01962d00cee34a6d2d4_c958461a-26c5-4072-84f3-7607f4594b03.webp?v=1762825649","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ffb6ecaeea30b4aac40ab8dd66b3a8f1688191e_f7e3c2a4-1f7b-4fb8-a785-17e833e9c899.webp?v=1762825650","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/885bc3f3238eddc620e63b008bf1b1593dfb16da_b3d9dde5-e14e-4e25-8388-bc0c36c47549.webp?v=1762825651","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67974e0a1e5f71202d6173ff622d5205fdc24ccc_5c756242-4e5b-4752-b2f8-bd415ed8ce91.webp?v=1762825652","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6705c03c7c3069ebeace506f225df5a02350d579_55f928f8-097d-482e-a0c4-81d651464cd3.webp?v=1762825652","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48b66e947be5f0dad17c910576f53e4dd9c1a8a1_49850434-ea14-49d5-959a-bd85053dc25a.webp?v=1762825653","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cfc8bd204c14cfe915a15908c09127064a9a30a_a1e220c8-c291-418a-8c4a-86fc950005a4.webp?v=1762825654","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1_dd53916b-5471-47cc-948a-668428d76960.webp?v=1762825655","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23d76080720526dfb9f740b9956d10e325e624e6_d2a31b58-cae2-4f58-834e-b342fdb5db65.webp?v=1762825655","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c74ab188eb31294bbb570fb6a5f191dc0d377ab8_f2c22986-79b3-42fa-8274-3da225c93841.webp?v=1762825656"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cfc8bd204c14cfe915a15908c09127064a9a30a.webp?v=1762740273","options":["color"],"media":[{"alt":null,"id":26346174709859,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cfc8bd204c14cfe915a15908c09127064a9a30a.webp?v=1762740273"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cfc8bd204c14cfe915a15908c09127064a9a30a.webp?v=1762740273","width":2000},{"alt":null,"id":26346176282723,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c74ab188eb31294bbb570fb6a5f191dc0d377ab8.webp?v=1762740273"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c74ab188eb31294bbb570fb6a5f191dc0d377ab8.webp?v=1762740273","width":2000},{"alt":null,"id":26346177265763,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ffb6ecaeea30b4aac40ab8dd66b3a8f1688191e.webp?v=1762740274"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ffb6ecaeea30b4aac40ab8dd66b3a8f1688191e.webp?v=1762740274","width":2000},{"alt":null,"id":26346178773091,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6705c03c7c3069ebeace506f225df5a02350d579.webp?v=1762740275"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6705c03c7c3069ebeace506f225df5a02350d579.webp?v=1762740275","width":2000},{"alt":null,"id":26346180214883,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/885bc3f3238eddc620e63b008bf1b1593dfb16da.webp?v=1762740275"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/885bc3f3238eddc620e63b008bf1b1593dfb16da.webp?v=1762740275","width":2000},{"alt":null,"id":26346181296227,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1.webp?v=1762740276"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1.webp?v=1762740276","width":2000},{"alt":null,"id":26346182836323,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23d76080720526dfb9f740b9956d10e325e624e6.webp?v=1762740277"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23d76080720526dfb9f740b9956d10e325e624e6.webp?v=1762740277","width":2000},{"alt":null,"id":26346184343651,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60b57a59570ab1c232ebe01962d00cee34a6d2d4.webp?v=1762740277"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60b57a59570ab1c232ebe01962d00cee34a6d2d4.webp?v=1762740277","width":2000},{"alt":null,"id":26346185228387,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48b66e947be5f0dad17c910576f53e4dd9c1a8a1.webp?v=1762740278"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48b66e947be5f0dad17c910576f53e4dd9c1a8a1.webp?v=1762740278","width":2000},{"alt":null,"id":26346186801251,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/131384060898a65e7fe9aee9034bc243c507f9f0.webp?v=1762740279"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/131384060898a65e7fe9aee9034bc243c507f9f0.webp?v=1762740279","width":2000},{"alt":null,"id":26346188079203,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67974e0a1e5f71202d6173ff622d5205fdc24ccc.webp?v=1762740279"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67974e0a1e5f71202d6173ff622d5205fdc24ccc.webp?v=1762740279","width":2000},{"alt":null,"id":26351660138595,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/131384060898a65e7fe9aee9034bc243c507f9f0_74391bc9-5f57-431f-a2ff-cbbd1d5e962c.webp?v=1762825648"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/131384060898a65e7fe9aee9034bc243c507f9f0_74391bc9-5f57-431f-a2ff-cbbd1d5e962c.webp?v=1762825648","width":2000},{"alt":null,"id":26351660400739,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60b57a59570ab1c232ebe01962d00cee34a6d2d4_c958461a-26c5-4072-84f3-7607f4594b03.webp?v=1762825649"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/60b57a59570ab1c232ebe01962d00cee34a6d2d4_c958461a-26c5-4072-84f3-7607f4594b03.webp?v=1762825649","width":2000},{"alt":null,"id":26351660630115,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ffb6ecaeea30b4aac40ab8dd66b3a8f1688191e_f7e3c2a4-1f7b-4fb8-a785-17e833e9c899.webp?v=1762825650"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ffb6ecaeea30b4aac40ab8dd66b3a8f1688191e_f7e3c2a4-1f7b-4fb8-a785-17e833e9c899.webp?v=1762825650","width":2000},{"alt":null,"id":26351660793955,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/885bc3f3238eddc620e63b008bf1b1593dfb16da_b3d9dde5-e14e-4e25-8388-bc0c36c47549.webp?v=1762825651"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/885bc3f3238eddc620e63b008bf1b1593dfb16da_b3d9dde5-e14e-4e25-8388-bc0c36c47549.webp?v=1762825651","width":2000},{"alt":null,"id":26351661121635,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67974e0a1e5f71202d6173ff622d5205fdc24ccc_5c756242-4e5b-4752-b2f8-bd415ed8ce91.webp?v=1762825652"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67974e0a1e5f71202d6173ff622d5205fdc24ccc_5c756242-4e5b-4752-b2f8-bd415ed8ce91.webp?v=1762825652","width":2000},{"alt":null,"id":26351661547619,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6705c03c7c3069ebeace506f225df5a02350d579_55f928f8-097d-482e-a0c4-81d651464cd3.webp?v=1762825652"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6705c03c7c3069ebeace506f225df5a02350d579_55f928f8-097d-482e-a0c4-81d651464cd3.webp?v=1762825652","width":2000},{"alt":null,"id":26351661842531,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48b66e947be5f0dad17c910576f53e4dd9c1a8a1_49850434-ea14-49d5-959a-bd85053dc25a.webp?v=1762825653"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48b66e947be5f0dad17c910576f53e4dd9c1a8a1_49850434-ea14-49d5-959a-bd85053dc25a.webp?v=1762825653","width":2000},{"alt":null,"id":26351661940835,"position":19,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cfc8bd204c14cfe915a15908c09127064a9a30a_a1e220c8-c291-418a-8c4a-86fc950005a4.webp?v=1762825654"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cfc8bd204c14cfe915a15908c09127064a9a30a_a1e220c8-c291-418a-8c4a-86fc950005a4.webp?v=1762825654","width":2000},{"alt":null,"id":26351662202979,"position":20,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1_dd53916b-5471-47cc-948a-668428d76960.webp?v=1762825655"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1_dd53916b-5471-47cc-948a-668428d76960.webp?v=1762825655","width":2000},{"alt":null,"id":26351662497891,"position":21,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23d76080720526dfb9f740b9956d10e325e624e6_d2a31b58-cae2-4f58-834e-b342fdb5db65.webp?v=1762825655"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23d76080720526dfb9f740b9956d10e325e624e6_d2a31b58-cae2-4f58-834e-b342fdb5db65.webp?v=1762825655","width":2000},{"alt":null,"id":26351662956643,"position":22,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c74ab188eb31294bbb570fb6a5f191dc0d377ab8_f2c22986-79b3-42fa-8274-3da225c93841.webp?v=1762825656"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c74ab188eb31294bbb570fb6a5f191dc0d377ab8_f2c22986-79b3-42fa-8274-3da225c93841.webp?v=1762825656","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43827805487203,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118424-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786205270115,"product_id":7920131866723,"position":20,"created_at":"2025-11-11T09:47:32+08:00","updated_at":"2025-11-11T09:47:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1_dd53916b-5471-47cc-948a-668428d76960.webp?v=1762825655","variant_ids":[43827805487203]},"available":true,"name":"iPhone 12 mini 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":"NPB0118424-HD67","featured_media":{"alt":null,"id":26351662202979,"position":20,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1_dd53916b-5471-47cc-948a-668428d76960.webp?v=1762825655"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43827805487203,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118424-HD67","requires_shipping":true,"taxable":true,"featured_image":{"id":34786205270115,"product_id":7920131866723,"position":20,"created_at":"2025-11-11T09:47:32+08:00","updated_at":"2025-11-11T09:47:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1_dd53916b-5471-47cc-948a-668428d76960.webp?v=1762825655","variant_ids":[43827805487203]},"available":true,"name":"iPhone 12 mini 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":"NPB0118424-HD67","featured_media":{"alt":null,"id":26351662202979,"position":20,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a412d6875d6ed8b5e12a7982073bdc8a29cbd1_dd53916b-5471-47cc-948a-668428d76960.webp?v=1762825655"}},"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: "停產" }