$product = {"id":7921930469475,"title":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻","handle":"iphone-15-pro-solidx-hd74","description":null,"published_at":"2025-11-13T09:45:47+08:00","created_at":"2025-11-13T09:27:12+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 15 Pro","merge","reseller-incrediville"],"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":43834576961635,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793911353443,"product_id":7921930469475,"position":3,"created_at":"2025-11-13T09:27:18+08:00","updated_at":"2025-11-13T09:27:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b26d4825720f6e296fda459d55b6249c286313d.webp?v=1762997240","variant_ids":[43834576961635]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970B-HD74","featured_media":{"alt":null,"id":26359331717219,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b26d4825720f6e296fda459d55b6249c286313d.webp?v=1762997240"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834578796643,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793912598627,"product_id":7921930469475,"position":6,"created_at":"2025-11-13T09:27:20+08:00","updated_at":"2025-11-13T09:27:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20fb6e7d63079be5490e7f99a4bc63fb0115679.webp?v=1762997242","variant_ids":[43834578796643]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-HD74","featured_media":{"alt":null,"id":26359332929635,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20fb6e7d63079be5490e7f99a4bc63fb0115679.webp?v=1762997242"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834578927715,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793913778275,"product_id":7921930469475,"position":9,"created_at":"2025-11-13T09:27:23+08:00","updated_at":"2025-11-13T09:27:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1070b2567f0b85fb03c051186320a9d35f21c.webp?v=1762997244","variant_ids":[43834578927715]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-HD74","featured_media":{"alt":null,"id":26359333912675,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1070b2567f0b85fb03c051186320a9d35f21c.webp?v=1762997244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834578993251,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793912238179,"product_id":7921930469475,"position":5,"created_at":"2025-11-13T09:27:19+08:00","updated_at":"2025-11-13T09:27:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec7dbe24d989d10356b7ad2db954efca9fee6e0d.webp?v=1762997241","variant_ids":[43834578993251]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01297Z8-HD74","featured_media":{"alt":null,"id":26359332569187,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec7dbe24d989d10356b7ad2db954efca9fee6e0d.webp?v=1762997241"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834579026019,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793910730851,"product_id":7921930469475,"position":1,"created_at":"2025-11-13T09:27:16+08:00","updated_at":"2025-11-13T09:27:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d02e836d771202bc89a13739a6442d3cf87351a.webp?v=1762997238","variant_ids":[43834579026019]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970A-HD74","featured_media":{"alt":null,"id":26359330865251,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d02e836d771202bc89a13739a6442d3cf87351a.webp?v=1762997238"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d02e836d771202bc89a13739a6442d3cf87351a.webp?v=1762997238","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd63755c7c7cf37825d48c49491f99e383e95bfd.webp?v=1762997239","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b26d4825720f6e296fda459d55b6249c286313d.webp?v=1762997240","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35aa8d0f0bdccef1d28a22dfba1c539ac5276811.webp?v=1762997241","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec7dbe24d989d10356b7ad2db954efca9fee6e0d.webp?v=1762997241","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20fb6e7d63079be5490e7f99a4bc63fb0115679.webp?v=1762997242","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a84114c297ee094f0d75d941a7d4c9194f815e0e.webp?v=1762997243","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b5ba3ea4e7e154db73ac86d4209c74346d10dc1.webp?v=1762997244","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1070b2567f0b85fb03c051186320a9d35f21c.webp?v=1762997244","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/57cde49782fd38578e072ca4ff6545d41cddd1d3.webp?v=1762997245"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d02e836d771202bc89a13739a6442d3cf87351a.webp?v=1762997238","options":["color"],"media":[{"alt":null,"id":26359330865251,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d02e836d771202bc89a13739a6442d3cf87351a.webp?v=1762997238"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d02e836d771202bc89a13739a6442d3cf87351a.webp?v=1762997238","width":2000},{"alt":null,"id":26359331192931,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd63755c7c7cf37825d48c49491f99e383e95bfd.webp?v=1762997239"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dd63755c7c7cf37825d48c49491f99e383e95bfd.webp?v=1762997239","width":2000},{"alt":null,"id":26359331717219,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b26d4825720f6e296fda459d55b6249c286313d.webp?v=1762997240"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b26d4825720f6e296fda459d55b6249c286313d.webp?v=1762997240","width":2000},{"alt":null,"id":26359332044899,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35aa8d0f0bdccef1d28a22dfba1c539ac5276811.webp?v=1762997241"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35aa8d0f0bdccef1d28a22dfba1c539ac5276811.webp?v=1762997241","width":2000},{"alt":null,"id":26359332569187,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec7dbe24d989d10356b7ad2db954efca9fee6e0d.webp?v=1762997241"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec7dbe24d989d10356b7ad2db954efca9fee6e0d.webp?v=1762997241","width":2000},{"alt":null,"id":26359332929635,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20fb6e7d63079be5490e7f99a4bc63fb0115679.webp?v=1762997242"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20fb6e7d63079be5490e7f99a4bc63fb0115679.webp?v=1762997242","width":2000},{"alt":null,"id":26359333257315,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a84114c297ee094f0d75d941a7d4c9194f815e0e.webp?v=1762997243"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a84114c297ee094f0d75d941a7d4c9194f815e0e.webp?v=1762997243","width":2000},{"alt":null,"id":26359333486691,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b5ba3ea4e7e154db73ac86d4209c74346d10dc1.webp?v=1762997244"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b5ba3ea4e7e154db73ac86d4209c74346d10dc1.webp?v=1762997244","width":2000},{"alt":null,"id":26359333912675,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1070b2567f0b85fb03c051186320a9d35f21c.webp?v=1762997244"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1070b2567f0b85fb03c051186320a9d35f21c.webp?v=1762997244","width":2000},{"alt":null,"id":26359334240355,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/57cde49782fd38578e072ca4ff6545d41cddd1d3.webp?v=1762997245"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/57cde49782fd38578e072ca4ff6545d41cddd1d3.webp?v=1762997245","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43834576961635,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793911353443,"product_id":7921930469475,"position":3,"created_at":"2025-11-13T09:27:18+08:00","updated_at":"2025-11-13T09:27:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b26d4825720f6e296fda459d55b6249c286313d.webp?v=1762997240","variant_ids":[43834576961635]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970B-HD74","featured_media":{"alt":null,"id":26359331717219,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b26d4825720f6e296fda459d55b6249c286313d.webp?v=1762997240"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834578796643,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793912598627,"product_id":7921930469475,"position":6,"created_at":"2025-11-13T09:27:20+08:00","updated_at":"2025-11-13T09:27:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20fb6e7d63079be5490e7f99a4bc63fb0115679.webp?v=1762997242","variant_ids":[43834578796643]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-HD74","featured_media":{"alt":null,"id":26359332929635,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e20fb6e7d63079be5490e7f99a4bc63fb0115679.webp?v=1762997242"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834578927715,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793913778275,"product_id":7921930469475,"position":9,"created_at":"2025-11-13T09:27:23+08:00","updated_at":"2025-11-13T09:27:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1070b2567f0b85fb03c051186320a9d35f21c.webp?v=1762997244","variant_ids":[43834578927715]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-HD74","featured_media":{"alt":null,"id":26359333912675,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1070b2567f0b85fb03c051186320a9d35f21c.webp?v=1762997244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834578993251,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793912238179,"product_id":7921930469475,"position":5,"created_at":"2025-11-13T09:27:19+08:00","updated_at":"2025-11-13T09:27:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec7dbe24d989d10356b7ad2db954efca9fee6e0d.webp?v=1762997241","variant_ids":[43834578993251]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01297Z8-HD74","featured_media":{"alt":null,"id":26359332569187,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec7dbe24d989d10356b7ad2db954efca9fee6e0d.webp?v=1762997241"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834579026019,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793910730851,"product_id":7921930469475,"position":1,"created_at":"2025-11-13T09:27:16+08:00","updated_at":"2025-11-13T09:27:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d02e836d771202bc89a13739a6442d3cf87351a.webp?v=1762997238","variant_ids":[43834579026019]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970A-HD74","featured_media":{"alt":null,"id":26359330865251,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d02e836d771202bc89a13739a6442d3cf87351a.webp?v=1762997238"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43834576961635,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793911353443,"product_id":7921930469475,"position":3,"created_at":"2025-11-13T09:27:18+08:00","updated_at":"2025-11-13T09:27:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b26d4825720f6e296fda459d55b6249c286313d.webp?v=1762997240","variant_ids":[43834576961635]},"available":true,"name":"iPhone 15 Pro SolidX Incrediville 怪奇事物所 阿媽家的吻 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970B-HD74","featured_media":{"alt":null,"id":26359331717219,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b26d4825720f6e296fda459d55b6249c286313d.webp?v=1762997240"}},"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: "停產" }