$product = {"id":7937887830115,"title":"iPhone 13 mini Mod NX 進擊的巨人 Attack on Titan Q版巨人","handle":"iphone-13-mini-mod-nx-xu17","description":null,"published_at":"2025-12-12T10:39:24+08:00","created_at":"2025-12-11T15:50:59+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-attack-on-titan","device-iPhone 13 Mini","merge","reseller-attack-on-titan"],"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":43884290211939,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0122824-XU17","requires_shipping":true,"taxable":true,"featured_image":{"id":36479908610147,"product_id":7937887830115,"position":14,"created_at":"2026-08-04T18:26:46+08:00","updated_at":"2026-08-04T18:26:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_b218c2ef-e112-41be-9178-c543ae4f4794.webp?v=1785839208","variant_ids":[43884290211939]},"available":true,"name":"iPhone 13 mini Mod NX 進擊的巨人 Attack on Titan Q版巨人 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0122824-XU17","featured_media":{"alt":null,"id":27983227846755,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_b218c2ef-e112-41be-9178-c543ae4f4794.webp?v=1785839208"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884290277475,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0122804-XU17","requires_shipping":true,"taxable":true,"featured_image":{"id":36479908839523,"product_id":7937887830115,"position":15,"created_at":"2026-08-04T18:26:48+08:00","updated_at":"2026-08-04T18:26:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_6e0c0a9a-221b-4016-b6cb-58880bd8aa85.webp?v=1785839210","variant_ids":[43884290277475]},"available":true,"name":"iPhone 13 mini Mod NX 進擊的巨人 Attack on Titan Q版巨人 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0122804-XU17","featured_media":{"alt":null,"id":27983228108899,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_6e0c0a9a-221b-4016-b6cb-58880bd8aa85.webp?v=1785839210"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884290310243,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01228J5-XU17","requires_shipping":true,"taxable":true,"featured_image":{"id":36479908184163,"product_id":7937887830115,"position":13,"created_at":"2026-08-04T18:26:45+08:00","updated_at":"2026-08-04T18:26:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_6c63af7a-7e3f-45d4-9daa-349d0ab2c7f4.webp?v=1785839207","variant_ids":[43884290310243]},"available":true,"name":"iPhone 13 mini Mod NX 進擊的巨人 Attack on Titan Q版巨人 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01228J5-XU17","featured_media":{"alt":null,"id":27983227453539,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_6c63af7a-7e3f-45d4-9daa-349d0ab2c7f4.webp?v=1785839207"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89.webp?v=1765439465","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b393d862380f379e22d204e2e815f1d8c1466746.webp?v=1765439465","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e64f3dde64befff6ac8c7c61ec433adea9191c6.webp?v=1765439466","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/345dadf53c6c44bee44882fa3dff989eedebfdd6.webp?v=1765439467","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e34214cf069df0153c62cfdc7dfc7660d39ad904.webp?v=1765439467","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2568c152e954e3527c393fdbd583dbba085b9f51.webp?v=1765439467","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3.webp?v=1765439468","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846.webp?v=1765439468","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcdc4f53988a3456a5e4e5fa73cc5d0708f47f5c.webp?v=1765439469","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_5bcb62c9-9502-4576-bd73-2c24b91ea9ed.webp?v=1783560989","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_5fd582e6-351c-4c3e-87cd-0e104f919e7a.webp?v=1783560990","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_e70700f9-fae2-454b-92f6-b113489ef086.webp?v=1783560992","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_6c63af7a-7e3f-45d4-9daa-349d0ab2c7f4.webp?v=1785839207","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_b218c2ef-e112-41be-9178-c543ae4f4794.webp?v=1785839208","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_6e0c0a9a-221b-4016-b6cb-58880bd8aa85.webp?v=1785839210"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89.webp?v=1765439465","options":["color"],"media":[{"alt":null,"id":26495327633507,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89.webp?v=1765439465"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89.webp?v=1765439465","width":2000},{"alt":null,"id":26495327764579,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b393d862380f379e22d204e2e815f1d8c1466746.webp?v=1765439465"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b393d862380f379e22d204e2e815f1d8c1466746.webp?v=1765439465","width":2000},{"alt":null,"id":26495327961187,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e64f3dde64befff6ac8c7c61ec433adea9191c6.webp?v=1765439466"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e64f3dde64befff6ac8c7c61ec433adea9191c6.webp?v=1765439466","width":2000},{"alt":null,"id":26495328157795,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/345dadf53c6c44bee44882fa3dff989eedebfdd6.webp?v=1765439467"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/345dadf53c6c44bee44882fa3dff989eedebfdd6.webp?v=1765439467","width":2000},{"alt":null,"id":26495328354403,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e34214cf069df0153c62cfdc7dfc7660d39ad904.webp?v=1765439467"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e34214cf069df0153c62cfdc7dfc7660d39ad904.webp?v=1765439467","width":2000},{"alt":null,"id":26495328649315,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2568c152e954e3527c393fdbd583dbba085b9f51.webp?v=1765439467"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2568c152e954e3527c393fdbd583dbba085b9f51.webp?v=1765439467","width":2000},{"alt":null,"id":26495328878691,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3.webp?v=1765439468"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3.webp?v=1765439468","width":2000},{"alt":null,"id":26495329075299,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846.webp?v=1765439468"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846.webp?v=1765439468","width":2000},{"alt":null,"id":26495329239139,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcdc4f53988a3456a5e4e5fa73cc5d0708f47f5c.webp?v=1765439469"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fcdc4f53988a3456a5e4e5fa73cc5d0708f47f5c.webp?v=1765439469","width":2000},{"alt":null,"id":27730620219491,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_5bcb62c9-9502-4576-bd73-2c24b91ea9ed.webp?v=1783560989"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_5bcb62c9-9502-4576-bd73-2c24b91ea9ed.webp?v=1783560989","width":2000},{"alt":null,"id":27730620645475,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_5fd582e6-351c-4c3e-87cd-0e104f919e7a.webp?v=1783560990"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_5fd582e6-351c-4c3e-87cd-0e104f919e7a.webp?v=1783560990","width":2000},{"alt":null,"id":27730621792355,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_e70700f9-fae2-454b-92f6-b113489ef086.webp?v=1783560992"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_e70700f9-fae2-454b-92f6-b113489ef086.webp?v=1783560992","width":2000},{"alt":null,"id":27983227453539,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_6c63af7a-7e3f-45d4-9daa-349d0ab2c7f4.webp?v=1785839207"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_6c63af7a-7e3f-45d4-9daa-349d0ab2c7f4.webp?v=1785839207","width":2000},{"alt":null,"id":27983227846755,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_b218c2ef-e112-41be-9178-c543ae4f4794.webp?v=1785839208"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_b218c2ef-e112-41be-9178-c543ae4f4794.webp?v=1785839208","width":2000},{"alt":null,"id":27983228108899,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_6e0c0a9a-221b-4016-b6cb-58880bd8aa85.webp?v=1785839210"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_6e0c0a9a-221b-4016-b6cb-58880bd8aa85.webp?v=1785839210","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43884290211939,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0122824-XU17","requires_shipping":true,"taxable":true,"featured_image":{"id":36479908610147,"product_id":7937887830115,"position":14,"created_at":"2026-08-04T18:26:46+08:00","updated_at":"2026-08-04T18:26:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_b218c2ef-e112-41be-9178-c543ae4f4794.webp?v=1785839208","variant_ids":[43884290211939]},"available":true,"name":"iPhone 13 mini Mod NX 進擊的巨人 Attack on Titan Q版巨人 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0122824-XU17","featured_media":{"alt":null,"id":27983227846755,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_b218c2ef-e112-41be-9178-c543ae4f4794.webp?v=1785839208"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884290277475,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0122804-XU17","requires_shipping":true,"taxable":true,"featured_image":{"id":36479908839523,"product_id":7937887830115,"position":15,"created_at":"2026-08-04T18:26:48+08:00","updated_at":"2026-08-04T18:26:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_6e0c0a9a-221b-4016-b6cb-58880bd8aa85.webp?v=1785839210","variant_ids":[43884290277475]},"available":true,"name":"iPhone 13 mini Mod NX 進擊的巨人 Attack on Titan Q版巨人 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0122804-XU17","featured_media":{"alt":null,"id":27983228108899,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22ab6b0828e5858cef07a4bfc1556be3881f1846_6e0c0a9a-221b-4016-b6cb-58880bd8aa85.webp?v=1785839210"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884290310243,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01228J5-XU17","requires_shipping":true,"taxable":true,"featured_image":{"id":36479908184163,"product_id":7937887830115,"position":13,"created_at":"2026-08-04T18:26:45+08:00","updated_at":"2026-08-04T18:26:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_6c63af7a-7e3f-45d4-9daa-349d0ab2c7f4.webp?v=1785839207","variant_ids":[43884290310243]},"available":true,"name":"iPhone 13 mini Mod NX 進擊的巨人 Attack on Titan Q版巨人 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01228J5-XU17","featured_media":{"alt":null,"id":27983227453539,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/087ccb224112eff30da8d65c2066c7a7c76e7fa3_6c63af7a-7e3f-45d4-9daa-349d0ab2c7f4.webp?v=1785839207"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43884290211939,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0122824-XU17","requires_shipping":true,"taxable":true,"featured_image":{"id":36479908610147,"product_id":7937887830115,"position":14,"created_at":"2026-08-04T18:26:46+08:00","updated_at":"2026-08-04T18:26:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_b218c2ef-e112-41be-9178-c543ae4f4794.webp?v=1785839208","variant_ids":[43884290211939]},"available":true,"name":"iPhone 13 mini Mod NX 進擊的巨人 Attack on Titan Q版巨人 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0122824-XU17","featured_media":{"alt":null,"id":27983227846755,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a9110cd9c45990da02b79d6bd741710cbf2f6c89_b218c2ef-e112-41be-9178-c543ae4f4794.webp?v=1785839208"}},"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: "停產" }