$product = {"id":7937914863715,"title":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan 超大型巨人","handle":"iphone-12-mini-solidsuit-classic-xu09","description":null,"published_at":"2025-12-12T10:33:28+08:00","created_at":"2025-12-11T15:57:08+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-attack-on-titan","device-iPhone 12 Mini","merge","reseller-attack-on-titan"],"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":43884397723747,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-XU09","requires_shipping":true,"taxable":true,"featured_image":{"id":36225794146403,"product_id":7937914863715,"position":13,"created_at":"2026-07-09T09:34:01+08:00","updated_at":"2026-07-09T09:34:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de_0644763e-f073-496a-8fa2-8e26a3fd5248.webp?v=1783560843","variant_ids":[43884397723747]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan 超大型巨人 - 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-XU09","featured_media":{"alt":null,"id":27730579751011,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de_0644763e-f073-496a-8fa2-8e26a3fd5248.webp?v=1783560843"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884397789283,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-XU09","requires_shipping":true,"taxable":true,"featured_image":{"id":36225795424355,"product_id":7937914863715,"position":15,"created_at":"2026-07-09T09:34:02+08:00","updated_at":"2026-07-09T09:34:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507_b175ae7a-00da-4f6c-9b3d-bc025a42c858.webp?v=1783560845","variant_ids":[43884397789283]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan 超大型巨人 - 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-XU09","featured_media":{"alt":null,"id":27730581061731,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507_b175ae7a-00da-4f6c-9b3d-bc025a42c858.webp?v=1783560845"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884397822051,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-XU09","requires_shipping":true,"taxable":true,"featured_image":{"id":36225792639075,"product_id":7937914863715,"position":12,"created_at":"2026-07-09T09:34:00+08:00","updated_at":"2026-07-09T09:34:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89_69731b92-5ac6-4abf-b687-11f83128b329.webp?v=1783560842","variant_ids":[43884397822051]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan 超大型巨人 - 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-XU09","featured_media":{"alt":null,"id":27730578210915,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89_69731b92-5ac6-4abf-b687-11f83128b329.webp?v=1783560842"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f8e1d448504cf04ad0f06e7d36503042a2ace58.webp?v=1765439837","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89.webp?v=1765439837","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507.webp?v=1765439838","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/129151c7db51525918107fa8ee90ae68dbc8da7e.webp?v=1765439838","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1273c8087a73dc71b29c3c3580c1166ce6edc1c1.webp?v=1765439839","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb949079b86f046f44b24b7239f8b60b89690b71.webp?v=1765439839","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02b340439f7cdaa2d441a7a8a670f6da04959a79.webp?v=1765439840","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de.webp?v=1765439840","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/979a3a068ae5aa277792dddfbe84bdeefb0033f1.webp?v=1765439840","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02b340439f7cdaa2d441a7a8a670f6da04959a79_c86966c6-a7a1-4158-a5ec-8d3a82f77538.webp?v=1783560840","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb949079b86f046f44b24b7239f8b60b89690b71_cba04a9d-d953-4a5a-9c53-75bab757d099.webp?v=1783560841","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89_69731b92-5ac6-4abf-b687-11f83128b329.webp?v=1783560842","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de_0644763e-f073-496a-8fa2-8e26a3fd5248.webp?v=1783560843","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/129151c7db51525918107fa8ee90ae68dbc8da7e_8cc36081-29f4-44db-bf74-ff7ab766886f.webp?v=1783560844","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507_b175ae7a-00da-4f6c-9b3d-bc025a42c858.webp?v=1783560845"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f8e1d448504cf04ad0f06e7d36503042a2ace58.webp?v=1765439837","options":["color"],"media":[{"alt":null,"id":26495441076323,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f8e1d448504cf04ad0f06e7d36503042a2ace58.webp?v=1765439837"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9f8e1d448504cf04ad0f06e7d36503042a2ace58.webp?v=1765439837","width":2000},{"alt":null,"id":26495441207395,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89.webp?v=1765439837"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89.webp?v=1765439837","width":2000},{"alt":null,"id":26495441404003,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507.webp?v=1765439838"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507.webp?v=1765439838","width":2000},{"alt":null,"id":26495441567843,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/129151c7db51525918107fa8ee90ae68dbc8da7e.webp?v=1765439838"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/129151c7db51525918107fa8ee90ae68dbc8da7e.webp?v=1765439838","width":2000},{"alt":null,"id":26495441731683,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1273c8087a73dc71b29c3c3580c1166ce6edc1c1.webp?v=1765439839"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1273c8087a73dc71b29c3c3580c1166ce6edc1c1.webp?v=1765439839","width":2000},{"alt":null,"id":26495441862755,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb949079b86f046f44b24b7239f8b60b89690b71.webp?v=1765439839"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb949079b86f046f44b24b7239f8b60b89690b71.webp?v=1765439839","width":2000},{"alt":null,"id":26495441993827,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02b340439f7cdaa2d441a7a8a670f6da04959a79.webp?v=1765439840"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02b340439f7cdaa2d441a7a8a670f6da04959a79.webp?v=1765439840","width":2000},{"alt":null,"id":26495442124899,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de.webp?v=1765439840"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de.webp?v=1765439840","width":2000},{"alt":null,"id":26495442288739,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/979a3a068ae5aa277792dddfbe84bdeefb0033f1.webp?v=1765439840"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/979a3a068ae5aa277792dddfbe84bdeefb0033f1.webp?v=1765439840","width":2000},{"alt":null,"id":27730577129571,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02b340439f7cdaa2d441a7a8a670f6da04959a79_c86966c6-a7a1-4158-a5ec-8d3a82f77538.webp?v=1783560840"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02b340439f7cdaa2d441a7a8a670f6da04959a79_c86966c6-a7a1-4158-a5ec-8d3a82f77538.webp?v=1783560840","width":2000},{"alt":null,"id":27730577719395,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb949079b86f046f44b24b7239f8b60b89690b71_cba04a9d-d953-4a5a-9c53-75bab757d099.webp?v=1783560841"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb949079b86f046f44b24b7239f8b60b89690b71_cba04a9d-d953-4a5a-9c53-75bab757d099.webp?v=1783560841","width":2000},{"alt":null,"id":27730578210915,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89_69731b92-5ac6-4abf-b687-11f83128b329.webp?v=1783560842"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89_69731b92-5ac6-4abf-b687-11f83128b329.webp?v=1783560842","width":2000},{"alt":null,"id":27730579751011,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de_0644763e-f073-496a-8fa2-8e26a3fd5248.webp?v=1783560843"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de_0644763e-f073-496a-8fa2-8e26a3fd5248.webp?v=1783560843","width":2000},{"alt":null,"id":27730580701283,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/129151c7db51525918107fa8ee90ae68dbc8da7e_8cc36081-29f4-44db-bf74-ff7ab766886f.webp?v=1783560844"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/129151c7db51525918107fa8ee90ae68dbc8da7e_8cc36081-29f4-44db-bf74-ff7ab766886f.webp?v=1783560844","width":2000},{"alt":null,"id":27730581061731,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507_b175ae7a-00da-4f6c-9b3d-bc025a42c858.webp?v=1783560845"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507_b175ae7a-00da-4f6c-9b3d-bc025a42c858.webp?v=1783560845","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43884397723747,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-XU09","requires_shipping":true,"taxable":true,"featured_image":{"id":36225794146403,"product_id":7937914863715,"position":13,"created_at":"2026-07-09T09:34:01+08:00","updated_at":"2026-07-09T09:34:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de_0644763e-f073-496a-8fa2-8e26a3fd5248.webp?v=1783560843","variant_ids":[43884397723747]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan 超大型巨人 - 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-XU09","featured_media":{"alt":null,"id":27730579751011,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de_0644763e-f073-496a-8fa2-8e26a3fd5248.webp?v=1783560843"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884397789283,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-XU09","requires_shipping":true,"taxable":true,"featured_image":{"id":36225795424355,"product_id":7937914863715,"position":15,"created_at":"2026-07-09T09:34:02+08:00","updated_at":"2026-07-09T09:34:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507_b175ae7a-00da-4f6c-9b3d-bc025a42c858.webp?v=1783560845","variant_ids":[43884397789283]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan 超大型巨人 - 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-XU09","featured_media":{"alt":null,"id":27730581061731,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb395f3e2af113dc4bfd74b7b261c6f24bf2507_b175ae7a-00da-4f6c-9b3d-bc025a42c858.webp?v=1783560845"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884397822051,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-XU09","requires_shipping":true,"taxable":true,"featured_image":{"id":36225792639075,"product_id":7937914863715,"position":12,"created_at":"2026-07-09T09:34:00+08:00","updated_at":"2026-07-09T09:34:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89_69731b92-5ac6-4abf-b687-11f83128b329.webp?v=1783560842","variant_ids":[43884397822051]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan 超大型巨人 - 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-XU09","featured_media":{"alt":null,"id":27730578210915,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aff80585815f4a17ff9bfc87285be656315a7e89_69731b92-5ac6-4abf-b687-11f83128b329.webp?v=1783560842"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43884397723747,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-XU09","requires_shipping":true,"taxable":true,"featured_image":{"id":36225794146403,"product_id":7937914863715,"position":13,"created_at":"2026-07-09T09:34:01+08:00","updated_at":"2026-07-09T09:34:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de_0644763e-f073-496a-8fa2-8e26a3fd5248.webp?v=1783560843","variant_ids":[43884397723747]},"available":true,"name":"iPhone 12 mini SolidSuit 進擊的巨人 Attack on Titan 超大型巨人 - 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-XU09","featured_media":{"alt":null,"id":27730579751011,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82ab9288e67dd0398c8bbc959a53fbee657b01de_0644763e-f073-496a-8fa2-8e26a3fd5248.webp?v=1783560843"}},"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: "停產" }