$product = {"id":7911325991011,"title":"iPhone 12 mini SolidSuit PosterLad Arial","handle":"iphone-12-mini-solidsuit-classic-pos01","description":null,"published_at":"2025-11-05T10:28:31+08:00","created_at":"2025-11-04T10:57:41+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-posterlad","device-iPhone 12 Mini","merge","reseller-posterlad"],"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":43812326277219,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-POS01","requires_shipping":true,"taxable":true,"featured_image":{"id":36403567001699,"product_id":7911325991011,"position":15,"created_at":"2026-07-27T16:37:09+08:00","updated_at":"2026-07-27T16:37:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547_8e5eef60-943b-4f5c-a9cc-eee903dc9cd9.webp?v=1785141431","variant_ids":[43812326277219]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad Arial - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118452-POS01","featured_media":{"alt":null,"id":27907175022691,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547_8e5eef60-943b-4f5c-a9cc-eee903dc9cd9.webp?v=1785141431"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812326342755,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-POS01","requires_shipping":true,"taxable":true,"featured_image":{"id":36403561496675,"product_id":7911325991011,"position":11,"created_at":"2026-07-27T16:36:57+08:00","updated_at":"2026-07-27T16:37:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943_4588a554-af6d-4941-bdd1-d3e81eef6e81.webp?v=1785141420","variant_ids":[43812326342755]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad Arial - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011840B-POS01","featured_media":{"alt":null,"id":27907169255523,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943_4588a554-af6d-4941-bdd1-d3e81eef6e81.webp?v=1785141420"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812326441059,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-POS01","requires_shipping":true,"taxable":true,"featured_image":{"id":36403566116963,"product_id":7911325991011,"position":14,"created_at":"2026-07-27T16:37:06+08:00","updated_at":"2026-07-27T16:37:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d_c4a9f70a-7fb6-4ff6-aabc-9141f9c33827.webp?v=1785141429","variant_ids":[43812326441059]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad Arial - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01184O9-POS01","featured_media":{"alt":null,"id":27907174072419,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d_c4a9f70a-7fb6-4ff6-aabc-9141f9c33827.webp?v=1785141429"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb5a3c895b022f84a87af7dbdb5ceac70b67a422.webp?v=1762225065","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ef0f38d66ad2dcb0c194540389b20203afbe90c.webp?v=1762225066","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d.webp?v=1762225067","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a3f4e6548898d2542d7665fd7926180ffab5d2d.webp?v=1762225067","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bc67335f8a6e0921290109f481e197e5c4dc417e.webp?v=1762225068","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943.webp?v=1762225069","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547.webp?v=1762225070","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fd3a7ce203c10a9ee1664e6cb6bb189782760aa.webp?v=1762225071","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ccebf54e744b0b4de7619da03a222557c0e4001.webp?v=1762225072","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb5a3c895b022f84a87af7dbdb5ceac70b67a422_1e08c58a-443f-44ac-ae8b-4f1e62cd1e48.webp?v=1785141417","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943_4588a554-af6d-4941-bdd1-d3e81eef6e81.webp?v=1785141420","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fd3a7ce203c10a9ee1664e6cb6bb189782760aa_215a7e0a-350f-49ce-aea8-dba6f0cdb14a.webp?v=1785141422","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ccebf54e744b0b4de7619da03a222557c0e4001_c5b8c52d-54a7-479a-b140-1b5e115d49b4.webp?v=1785141426","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d_c4a9f70a-7fb6-4ff6-aabc-9141f9c33827.webp?v=1785141429","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547_8e5eef60-943b-4f5c-a9cc-eee903dc9cd9.webp?v=1785141431"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb5a3c895b022f84a87af7dbdb5ceac70b67a422.webp?v=1762225065","options":["color"],"media":[{"alt":null,"id":26297297633379,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb5a3c895b022f84a87af7dbdb5ceac70b67a422.webp?v=1762225065"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb5a3c895b022f84a87af7dbdb5ceac70b67a422.webp?v=1762225065","width":2000},{"alt":null,"id":26297297862755,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ef0f38d66ad2dcb0c194540389b20203afbe90c.webp?v=1762225066"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ef0f38d66ad2dcb0c194540389b20203afbe90c.webp?v=1762225066","width":2000},{"alt":null,"id":26297298124899,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d.webp?v=1762225067"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d.webp?v=1762225067","width":2000},{"alt":null,"id":26297298354275,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a3f4e6548898d2542d7665fd7926180ffab5d2d.webp?v=1762225067"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a3f4e6548898d2542d7665fd7926180ffab5d2d.webp?v=1762225067","width":2000},{"alt":null,"id":26297298583651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bc67335f8a6e0921290109f481e197e5c4dc417e.webp?v=1762225068"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bc67335f8a6e0921290109f481e197e5c4dc417e.webp?v=1762225068","width":2000},{"alt":null,"id":26297298944099,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943.webp?v=1762225069"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943.webp?v=1762225069","width":2000},{"alt":null,"id":26297299107939,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547.webp?v=1762225070"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547.webp?v=1762225070","width":2000},{"alt":null,"id":26297299337315,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fd3a7ce203c10a9ee1664e6cb6bb189782760aa.webp?v=1762225071"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fd3a7ce203c10a9ee1664e6cb6bb189782760aa.webp?v=1762225071","width":2000},{"alt":null,"id":26297299468387,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ccebf54e744b0b4de7619da03a222557c0e4001.webp?v=1762225072"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ccebf54e744b0b4de7619da03a222557c0e4001.webp?v=1762225072","width":2000},{"alt":null,"id":27907168010339,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb5a3c895b022f84a87af7dbdb5ceac70b67a422_1e08c58a-443f-44ac-ae8b-4f1e62cd1e48.webp?v=1785141417"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb5a3c895b022f84a87af7dbdb5ceac70b67a422_1e08c58a-443f-44ac-ae8b-4f1e62cd1e48.webp?v=1785141417","width":2000},{"alt":null,"id":27907169255523,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943_4588a554-af6d-4941-bdd1-d3e81eef6e81.webp?v=1785141420"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943_4588a554-af6d-4941-bdd1-d3e81eef6e81.webp?v=1785141420","width":2000},{"alt":null,"id":27907170992227,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fd3a7ce203c10a9ee1664e6cb6bb189782760aa_215a7e0a-350f-49ce-aea8-dba6f0cdb14a.webp?v=1785141422"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fd3a7ce203c10a9ee1664e6cb6bb189782760aa_215a7e0a-350f-49ce-aea8-dba6f0cdb14a.webp?v=1785141422","width":2000},{"alt":null,"id":27907173023843,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ccebf54e744b0b4de7619da03a222557c0e4001_c5b8c52d-54a7-479a-b140-1b5e115d49b4.webp?v=1785141426"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ccebf54e744b0b4de7619da03a222557c0e4001_c5b8c52d-54a7-479a-b140-1b5e115d49b4.webp?v=1785141426","width":2000},{"alt":null,"id":27907174072419,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d_c4a9f70a-7fb6-4ff6-aabc-9141f9c33827.webp?v=1785141429"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d_c4a9f70a-7fb6-4ff6-aabc-9141f9c33827.webp?v=1785141429","width":2000},{"alt":null,"id":27907175022691,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547_8e5eef60-943b-4f5c-a9cc-eee903dc9cd9.webp?v=1785141431"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547_8e5eef60-943b-4f5c-a9cc-eee903dc9cd9.webp?v=1785141431","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43812326277219,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-POS01","requires_shipping":true,"taxable":true,"featured_image":{"id":36403567001699,"product_id":7911325991011,"position":15,"created_at":"2026-07-27T16:37:09+08:00","updated_at":"2026-07-27T16:37:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547_8e5eef60-943b-4f5c-a9cc-eee903dc9cd9.webp?v=1785141431","variant_ids":[43812326277219]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad Arial - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118452-POS01","featured_media":{"alt":null,"id":27907175022691,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547_8e5eef60-943b-4f5c-a9cc-eee903dc9cd9.webp?v=1785141431"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812326342755,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-POS01","requires_shipping":true,"taxable":true,"featured_image":{"id":36403561496675,"product_id":7911325991011,"position":11,"created_at":"2026-07-27T16:36:57+08:00","updated_at":"2026-07-27T16:37:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943_4588a554-af6d-4941-bdd1-d3e81eef6e81.webp?v=1785141420","variant_ids":[43812326342755]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad Arial - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011840B-POS01","featured_media":{"alt":null,"id":27907169255523,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a0d80cb2eff78af1719de79dadb192ab15d6943_4588a554-af6d-4941-bdd1-d3e81eef6e81.webp?v=1785141420"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812326441059,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-POS01","requires_shipping":true,"taxable":true,"featured_image":{"id":36403566116963,"product_id":7911325991011,"position":14,"created_at":"2026-07-27T16:37:06+08:00","updated_at":"2026-07-27T16:37:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d_c4a9f70a-7fb6-4ff6-aabc-9141f9c33827.webp?v=1785141429","variant_ids":[43812326441059]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad Arial - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01184O9-POS01","featured_media":{"alt":null,"id":27907174072419,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fb7bbdc1a93654151550f2a20dcae0f81bb674d_c4a9f70a-7fb6-4ff6-aabc-9141f9c33827.webp?v=1785141429"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43812326277219,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-POS01","requires_shipping":true,"taxable":true,"featured_image":{"id":36403567001699,"product_id":7911325991011,"position":15,"created_at":"2026-07-27T16:37:09+08:00","updated_at":"2026-07-27T16:37:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547_8e5eef60-943b-4f5c-a9cc-eee903dc9cd9.webp?v=1785141431","variant_ids":[43812326277219]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad Arial - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118452-POS01","featured_media":{"alt":null,"id":27907175022691,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5293dd1002f1e8a95af21fcb9b5a523ee0106547_8e5eef60-943b-4f5c-a9cc-eee903dc9cd9.webp?v=1785141431"}},"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: "停產" }