$product = {"id":7888959275107,"title":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull","handle":"iphone-13-pro-max-solidsuit-classic-magsafe-tb34","description":null,"published_at":"2025-09-24T11:17:36+08:00","created_at":"2025-09-23T12:07:02+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-oracle-redbull-racing","device-iPhone 13 Pro Max","merge","reseller-oracle-redbull-racing"],"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":43744874823779,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012320C-TB34","requires_shipping":true,"taxable":true,"featured_image":{"id":36153794134115,"product_id":7888959275107,"position":11,"created_at":"2026-07-02T15:04:07+08:00","updated_at":"2026-07-02T15:04:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6_219eece7-69ac-4d2a-9cc3-67ae97888a46.webp?v=1782975849","variant_ids":[43744874823779]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320C-TB34","featured_media":{"alt":null,"id":27658667163747,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6_219eece7-69ac-4d2a-9cc3-67ae97888a46.webp?v=1782975849"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744876953699,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST012320B-TB34","requires_shipping":true,"taxable":true,"featured_image":{"id":36153793478755,"product_id":7888959275107,"position":8,"created_at":"2026-07-02T15:04:05+08:00","updated_at":"2026-07-02T15:04:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04_732c3bf7-02e6-4786-9e4c-8b2e7901a9cb.webp?v=1782975847","variant_ids":[43744876953699]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull - 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":"MST012320B-TB34","featured_media":{"alt":null,"id":27658666541155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04_732c3bf7-02e6-4786-9e4c-8b2e7901a9cb.webp?v=1782975847"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744877019235,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"MST01232Z9-TB34","requires_shipping":true,"taxable":true,"featured_image":{"id":36153793970275,"product_id":7888959275107,"position":10,"created_at":"2026-07-02T15:04:06+08:00","updated_at":"2026-07-02T15:04:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff_56509d27-8513-4553-92ef-456f7522c697.webp?v=1782975848","variant_ids":[43744877019235]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01232Z9-TB34","featured_media":{"alt":null,"id":27658667032675,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff_56509d27-8513-4553-92ef-456f7522c697.webp?v=1782975848"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744877052003,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0123252-TB34","requires_shipping":true,"taxable":true,"featured_image":{"id":36153793773667,"product_id":7888959275107,"position":9,"created_at":"2026-07-02T15:04:05+08:00","updated_at":"2026-07-02T15:04:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45_b805479c-613d-4c9c-aacd-c6adacbdffca.webp?v=1782975848","variant_ids":[43744877052003]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-TB34","featured_media":{"alt":null,"id":27658666836067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45_b805479c-613d-4c9c-aacd-c6adacbdffca.webp?v=1782975848"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff.webp?v=1758600430","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6205fc3652227fbcaaaa9f5f282f3adb3cb62204.webp?v=1758600430","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/407479f12f72864707c49f9f50660944ea71947b.webp?v=1758600431","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6.webp?v=1758600431","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04.webp?v=1758600432","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ca184df3e08cdc6d1af6504d1e45580d7e472ec.webp?v=1758600433","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45.webp?v=1758600433","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04_732c3bf7-02e6-4786-9e4c-8b2e7901a9cb.webp?v=1782975847","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45_b805479c-613d-4c9c-aacd-c6adacbdffca.webp?v=1782975848","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff_56509d27-8513-4553-92ef-456f7522c697.webp?v=1782975848","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6_219eece7-69ac-4d2a-9cc3-67ae97888a46.webp?v=1782975849"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff.webp?v=1758600430","options":["color"],"media":[{"alt":null,"id":26088806056035,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff.webp?v=1758600430"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff.webp?v=1758600430","width":2000},{"alt":null,"id":26088806449251,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6205fc3652227fbcaaaa9f5f282f3adb3cb62204.webp?v=1758600430"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6205fc3652227fbcaaaa9f5f282f3adb3cb62204.webp?v=1758600430","width":2000},{"alt":null,"id":26088806744163,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/407479f12f72864707c49f9f50660944ea71947b.webp?v=1758600431"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/407479f12f72864707c49f9f50660944ea71947b.webp?v=1758600431","width":2000},{"alt":null,"id":26088806940771,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6.webp?v=1758600431"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6.webp?v=1758600431","width":2000},{"alt":null,"id":26088807071843,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04.webp?v=1758600432"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04.webp?v=1758600432","width":2000},{"alt":null,"id":26088807301219,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ca184df3e08cdc6d1af6504d1e45580d7e472ec.webp?v=1758600433"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ca184df3e08cdc6d1af6504d1e45580d7e472ec.webp?v=1758600433","width":2000},{"alt":null,"id":26088807465059,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45.webp?v=1758600433"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45.webp?v=1758600433","width":2000},{"alt":null,"id":27658666541155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04_732c3bf7-02e6-4786-9e4c-8b2e7901a9cb.webp?v=1782975847"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04_732c3bf7-02e6-4786-9e4c-8b2e7901a9cb.webp?v=1782975847","width":2000},{"alt":null,"id":27658666836067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45_b805479c-613d-4c9c-aacd-c6adacbdffca.webp?v=1782975848"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45_b805479c-613d-4c9c-aacd-c6adacbdffca.webp?v=1782975848","width":2000},{"alt":null,"id":27658667032675,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff_56509d27-8513-4553-92ef-456f7522c697.webp?v=1782975848"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff_56509d27-8513-4553-92ef-456f7522c697.webp?v=1782975848","width":2000},{"alt":null,"id":27658667163747,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6_219eece7-69ac-4d2a-9cc3-67ae97888a46.webp?v=1782975849"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6_219eece7-69ac-4d2a-9cc3-67ae97888a46.webp?v=1782975849","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43744874823779,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012320C-TB34","requires_shipping":true,"taxable":true,"featured_image":{"id":36153794134115,"product_id":7888959275107,"position":11,"created_at":"2026-07-02T15:04:07+08:00","updated_at":"2026-07-02T15:04:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6_219eece7-69ac-4d2a-9cc3-67ae97888a46.webp?v=1782975849","variant_ids":[43744874823779]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320C-TB34","featured_media":{"alt":null,"id":27658667163747,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6_219eece7-69ac-4d2a-9cc3-67ae97888a46.webp?v=1782975849"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744876953699,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST012320B-TB34","requires_shipping":true,"taxable":true,"featured_image":{"id":36153793478755,"product_id":7888959275107,"position":8,"created_at":"2026-07-02T15:04:05+08:00","updated_at":"2026-07-02T15:04:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04_732c3bf7-02e6-4786-9e4c-8b2e7901a9cb.webp?v=1782975847","variant_ids":[43744876953699]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull - 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":"MST012320B-TB34","featured_media":{"alt":null,"id":27658666541155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/690039d584888986e3d6b2d265130760eda45d04_732c3bf7-02e6-4786-9e4c-8b2e7901a9cb.webp?v=1782975847"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744877019235,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"MST01232Z9-TB34","requires_shipping":true,"taxable":true,"featured_image":{"id":36153793970275,"product_id":7888959275107,"position":10,"created_at":"2026-07-02T15:04:06+08:00","updated_at":"2026-07-02T15:04:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff_56509d27-8513-4553-92ef-456f7522c697.webp?v=1782975848","variant_ids":[43744877019235]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01232Z9-TB34","featured_media":{"alt":null,"id":27658667032675,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76a413b585b94b00e11a3dd4548bd5c18a122aff_56509d27-8513-4553-92ef-456f7522c697.webp?v=1782975848"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744877052003,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0123252-TB34","requires_shipping":true,"taxable":true,"featured_image":{"id":36153793773667,"product_id":7888959275107,"position":9,"created_at":"2026-07-02T15:04:05+08:00","updated_at":"2026-07-02T15:04:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45_b805479c-613d-4c9c-aacd-c6adacbdffca.webp?v=1782975848","variant_ids":[43744877052003]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-TB34","featured_media":{"alt":null,"id":27658666836067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07077d2d9eb5756e8a45999701564b5981279a45_b805479c-613d-4c9c-aacd-c6adacbdffca.webp?v=1782975848"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43744874823779,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012320C-TB34","requires_shipping":true,"taxable":true,"featured_image":{"id":36153794134115,"product_id":7888959275107,"position":11,"created_at":"2026-07-02T15:04:07+08:00","updated_at":"2026-07-02T15:04:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6_219eece7-69ac-4d2a-9cc3-67ae97888a46.webp?v=1782975849","variant_ids":[43744874823779]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) Oracle Red Bull Racing ORBR - Bull - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320C-TB34","featured_media":{"alt":null,"id":27658667163747,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c672771f2c39993cb07d835ab9cb0c5088e7cb6_219eece7-69ac-4d2a-9cc3-67ae97888a46.webp?v=1782975849"}},"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: "停產" }