$product = {"id":7911332577379,"title":"iPhone 15 Pro SolidX PosterLad 郊區","handle":"iphone-15-pro-solidx-pos08","description":null,"published_at":"2025-11-05T10:27:36+08:00","created_at":"2025-11-04T10:58:44+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-posterlad","device-iPhone 15 Pro","merge","reseller-posterlad"],"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":43812340334691,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729446768739,"product_id":7911332577379,"position":5,"created_at":"2025-11-04T10:58:50+08:00","updated_at":"2025-11-04T10:58:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06d249baec77e1c11a5e4ecd6d120751cdb723d8.webp?v=1762225132","variant_ids":[43812340334691]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297314377827,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06d249baec77e1c11a5e4ecd6d120751cdb723d8.webp?v=1762225132"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812343447651,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729447751779,"product_id":7911332577379,"position":8,"created_at":"2025-11-04T10:58:52+08:00","updated_at":"2025-11-04T10:58:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4009fae2b15c28690a7f8de303c1868cb5d3db92.webp?v=1762225134","variant_ids":[43812343447651]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297315328099,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4009fae2b15c28690a7f8de303c1868cb5d3db92.webp?v=1762225134"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812343480419,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729448144995,"product_id":7911332577379,"position":9,"created_at":"2025-11-04T10:58:53+08:00","updated_at":"2025-11-04T10:58:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/041cefcc839d417c9a1557ea6af65e120f4776a0.webp?v=1762225135","variant_ids":[43812343480419]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297315721315,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/041cefcc839d417c9a1557ea6af65e120f4776a0.webp?v=1762225135"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812343545955,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729445523555,"product_id":7911332577379,"position":1,"created_at":"2025-11-04T10:58:47+08:00","updated_at":"2025-11-04T10:58:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/214d155a5d7a48fe1f5040d9ea03c06c8a9d3e35.webp?v=1762225128","variant_ids":[43812343545955]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297313099875,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/214d155a5d7a48fe1f5040d9ea03c06c8a9d3e35.webp?v=1762225128"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812343611491,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729447096419,"product_id":7911332577379,"position":6,"created_at":"2025-11-04T10:58:51+08:00","updated_at":"2025-11-04T10:58:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3a70c08c93a03ac4e8c65ecf71a5fbd9c0a4fa0.webp?v=1762225133","variant_ids":[43812343611491]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297314639971,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3a70c08c93a03ac4e8c65ecf71a5fbd9c0a4fa0.webp?v=1762225133"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/214d155a5d7a48fe1f5040d9ea03c06c8a9d3e35.webp?v=1762225128","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9888bf078f8089d3077abe1e0a9ed8ecc25152d7.webp?v=1762225130","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1190cbd081025e7230d81c03315dcd27c41286b.webp?v=1762225131","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02c7210707a2bffa9d3bfe5902e01cf5feacd6af.webp?v=1762225131","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06d249baec77e1c11a5e4ecd6d120751cdb723d8.webp?v=1762225132","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3a70c08c93a03ac4e8c65ecf71a5fbd9c0a4fa0.webp?v=1762225133","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23b8940368dad25c7f1b518ffd2251a916f6202b.webp?v=1762225134","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4009fae2b15c28690a7f8de303c1868cb5d3db92.webp?v=1762225134","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/041cefcc839d417c9a1557ea6af65e120f4776a0.webp?v=1762225135","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba91b1b205a64f9fbd4cdff75af41f2750dc93f2.webp?v=1762225136"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/214d155a5d7a48fe1f5040d9ea03c06c8a9d3e35.webp?v=1762225128","options":["color"],"media":[{"alt":null,"id":26297313099875,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/214d155a5d7a48fe1f5040d9ea03c06c8a9d3e35.webp?v=1762225128"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/214d155a5d7a48fe1f5040d9ea03c06c8a9d3e35.webp?v=1762225128","width":2000},{"alt":null,"id":26297313329251,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9888bf078f8089d3077abe1e0a9ed8ecc25152d7.webp?v=1762225130"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9888bf078f8089d3077abe1e0a9ed8ecc25152d7.webp?v=1762225130","width":2000},{"alt":null,"id":26297313656931,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1190cbd081025e7230d81c03315dcd27c41286b.webp?v=1762225131"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1190cbd081025e7230d81c03315dcd27c41286b.webp?v=1762225131","width":2000},{"alt":null,"id":26297313984611,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02c7210707a2bffa9d3bfe5902e01cf5feacd6af.webp?v=1762225131"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02c7210707a2bffa9d3bfe5902e01cf5feacd6af.webp?v=1762225131","width":2000},{"alt":null,"id":26297314377827,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06d249baec77e1c11a5e4ecd6d120751cdb723d8.webp?v=1762225132"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06d249baec77e1c11a5e4ecd6d120751cdb723d8.webp?v=1762225132","width":2000},{"alt":null,"id":26297314639971,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3a70c08c93a03ac4e8c65ecf71a5fbd9c0a4fa0.webp?v=1762225133"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3a70c08c93a03ac4e8c65ecf71a5fbd9c0a4fa0.webp?v=1762225133","width":2000},{"alt":null,"id":26297314934883,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23b8940368dad25c7f1b518ffd2251a916f6202b.webp?v=1762225134"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23b8940368dad25c7f1b518ffd2251a916f6202b.webp?v=1762225134","width":2000},{"alt":null,"id":26297315328099,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4009fae2b15c28690a7f8de303c1868cb5d3db92.webp?v=1762225134"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4009fae2b15c28690a7f8de303c1868cb5d3db92.webp?v=1762225134","width":2000},{"alt":null,"id":26297315721315,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/041cefcc839d417c9a1557ea6af65e120f4776a0.webp?v=1762225135"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/041cefcc839d417c9a1557ea6af65e120f4776a0.webp?v=1762225135","width":2000},{"alt":null,"id":26297316081763,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba91b1b205a64f9fbd4cdff75af41f2750dc93f2.webp?v=1762225136"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba91b1b205a64f9fbd4cdff75af41f2750dc93f2.webp?v=1762225136","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43812340334691,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729446768739,"product_id":7911332577379,"position":5,"created_at":"2025-11-04T10:58:50+08:00","updated_at":"2025-11-04T10:58:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06d249baec77e1c11a5e4ecd6d120751cdb723d8.webp?v=1762225132","variant_ids":[43812340334691]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297314377827,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06d249baec77e1c11a5e4ecd6d120751cdb723d8.webp?v=1762225132"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812343447651,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729447751779,"product_id":7911332577379,"position":8,"created_at":"2025-11-04T10:58:52+08:00","updated_at":"2025-11-04T10:58:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4009fae2b15c28690a7f8de303c1868cb5d3db92.webp?v=1762225134","variant_ids":[43812343447651]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297315328099,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4009fae2b15c28690a7f8de303c1868cb5d3db92.webp?v=1762225134"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812343480419,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729448144995,"product_id":7911332577379,"position":9,"created_at":"2025-11-04T10:58:53+08:00","updated_at":"2025-11-04T10:58:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/041cefcc839d417c9a1557ea6af65e120f4776a0.webp?v=1762225135","variant_ids":[43812343480419]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297315721315,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/041cefcc839d417c9a1557ea6af65e120f4776a0.webp?v=1762225135"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812343545955,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729445523555,"product_id":7911332577379,"position":1,"created_at":"2025-11-04T10:58:47+08:00","updated_at":"2025-11-04T10:58:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/214d155a5d7a48fe1f5040d9ea03c06c8a9d3e35.webp?v=1762225128","variant_ids":[43812343545955]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297313099875,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/214d155a5d7a48fe1f5040d9ea03c06c8a9d3e35.webp?v=1762225128"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43812343611491,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729447096419,"product_id":7911332577379,"position":6,"created_at":"2025-11-04T10:58:51+08:00","updated_at":"2025-11-04T10:58:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3a70c08c93a03ac4e8c65ecf71a5fbd9c0a4fa0.webp?v=1762225133","variant_ids":[43812343611491]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297314639971,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3a70c08c93a03ac4e8c65ecf71a5fbd9c0a4fa0.webp?v=1762225133"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43812340334691,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-POS08","requires_shipping":true,"taxable":true,"featured_image":{"id":34729446768739,"product_id":7911332577379,"position":5,"created_at":"2025-11-04T10:58:50+08:00","updated_at":"2025-11-04T10:58:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06d249baec77e1c11a5e4ecd6d120751cdb723d8.webp?v=1762225132","variant_ids":[43812340334691]},"available":true,"name":"iPhone 15 Pro SolidX PosterLad 郊區 - 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-POS08","featured_media":{"alt":null,"id":26297314377827,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06d249baec77e1c11a5e4ecd6d120751cdb723d8.webp?v=1762225132"}},"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: "停產" }