$product = {"id":7836799598691,"title":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty","handle":"iphone-15-pro-max-solidx-bumper-back-crossover-design-yn28","description":null,"published_at":"2025-07-14T16:03:17+08:00","created_at":"2025-07-14T09:49:53+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-osamugoods","device-iPhone 15 Pro Max","merge","reseller-osamugoods"],"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":43525159551075,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179502735459,"product_id":7836799598691,"position":2,"created_at":"2025-07-14T14:44:28+08:00","updated_at":"2025-07-14T14:44:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3922e679c4e0d8dd01b7ba95a50528a319bfb067.webp?v=1752475470","variant_ids":[43525159551075]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-YN28","featured_media":{"alt":null,"id":25816852136035,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3922e679c4e0d8dd01b7ba95a50528a319bfb067.webp?v=1752475470"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525159583843,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179508469859,"product_id":7836799598691,"position":1,"created_at":"2025-07-14T14:44:28+08:00","updated_at":"2025-07-14T14:44:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bbe83ed6057a00ef5cff62ace85a52d46d44cd2.webp?v=1752475480","variant_ids":[43525159583843]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-YN28","featured_media":{"alt":null,"id":25816851841123,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bbe83ed6057a00ef5cff62ace85a52d46d44cd2.webp?v=1752475480"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525159714915,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179504439395,"product_id":7836799598691,"position":6,"created_at":"2025-07-14T14:44:30+08:00","updated_at":"2025-07-14T14:44:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/048dd9cdbb3df44b5ce07ebff3b00dc80b826fc0.webp?v=1752475472","variant_ids":[43525159714915]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-YN28","featured_media":{"alt":null,"id":25816853315683,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/048dd9cdbb3df44b5ce07ebff3b00dc80b826fc0.webp?v=1752475472"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525159747683,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179504799843,"product_id":7836799598691,"position":8,"created_at":"2025-07-14T14:44:31+08:00","updated_at":"2025-07-14T14:44:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5d268f73c9d4b0900cd419d2e92069fefe989e4.webp?v=1752475473","variant_ids":[43525159747683]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-YN28","featured_media":{"alt":null,"id":25816853512291,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5d268f73c9d4b0900cd419d2e92069fefe989e4.webp?v=1752475473"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525159780451,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179503390819,"product_id":7836799598691,"position":3,"created_at":"2025-07-14T14:44:29+08:00","updated_at":"2025-07-14T14:44:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9741e6bc8496004d93a4a539f70927ae65ecd566.webp?v=1752475470","variant_ids":[43525159780451]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-YN28","featured_media":{"alt":null,"id":25816852365411,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9741e6bc8496004d93a4a539f70927ae65ecd566.webp?v=1752475470"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bbe83ed6057a00ef5cff62ace85a52d46d44cd2.webp?v=1752475480","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3922e679c4e0d8dd01b7ba95a50528a319bfb067.webp?v=1752475470","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9741e6bc8496004d93a4a539f70927ae65ecd566.webp?v=1752475470","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c84788eef41016dd080790133fa9e379e8f2b22f.webp?v=1752475471","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011b66073583d02009203a8371f3d60f251e6ac2.webp?v=1752475471","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/048dd9cdbb3df44b5ce07ebff3b00dc80b826fc0.webp?v=1752475472","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0055e9487cf20f6a65e797559a925e915597eb87.webp?v=1752475472","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5d268f73c9d4b0900cd419d2e92069fefe989e4.webp?v=1752475473","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f50be5753d0ed087d14728573836ecdcca6fccd6.webp?v=1752475473","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa421202b579fbd360bd202a59c007d44043fbcc.webp?v=1752475474"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bbe83ed6057a00ef5cff62ace85a52d46d44cd2.webp?v=1752475480","options":["color"],"media":[{"alt":null,"id":25816851841123,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bbe83ed6057a00ef5cff62ace85a52d46d44cd2.webp?v=1752475480"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bbe83ed6057a00ef5cff62ace85a52d46d44cd2.webp?v=1752475480","width":2000},{"alt":null,"id":25816852136035,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3922e679c4e0d8dd01b7ba95a50528a319bfb067.webp?v=1752475470"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3922e679c4e0d8dd01b7ba95a50528a319bfb067.webp?v=1752475470","width":2000},{"alt":null,"id":25816852365411,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9741e6bc8496004d93a4a539f70927ae65ecd566.webp?v=1752475470"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9741e6bc8496004d93a4a539f70927ae65ecd566.webp?v=1752475470","width":2000},{"alt":null,"id":25816852627555,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c84788eef41016dd080790133fa9e379e8f2b22f.webp?v=1752475471"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c84788eef41016dd080790133fa9e379e8f2b22f.webp?v=1752475471","width":2000},{"alt":null,"id":25816852955235,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011b66073583d02009203a8371f3d60f251e6ac2.webp?v=1752475471"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011b66073583d02009203a8371f3d60f251e6ac2.webp?v=1752475471","width":2000},{"alt":null,"id":25816853315683,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/048dd9cdbb3df44b5ce07ebff3b00dc80b826fc0.webp?v=1752475472"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/048dd9cdbb3df44b5ce07ebff3b00dc80b826fc0.webp?v=1752475472","width":2000},{"alt":null,"id":25816853446755,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0055e9487cf20f6a65e797559a925e915597eb87.webp?v=1752475472"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0055e9487cf20f6a65e797559a925e915597eb87.webp?v=1752475472","width":2000},{"alt":null,"id":25816853512291,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5d268f73c9d4b0900cd419d2e92069fefe989e4.webp?v=1752475473"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5d268f73c9d4b0900cd419d2e92069fefe989e4.webp?v=1752475473","width":2000},{"alt":null,"id":25816853577827,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f50be5753d0ed087d14728573836ecdcca6fccd6.webp?v=1752475473"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f50be5753d0ed087d14728573836ecdcca6fccd6.webp?v=1752475473","width":2000},{"alt":null,"id":25816853708899,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa421202b579fbd360bd202a59c007d44043fbcc.webp?v=1752475474"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa421202b579fbd360bd202a59c007d44043fbcc.webp?v=1752475474","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43525159551075,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179502735459,"product_id":7836799598691,"position":2,"created_at":"2025-07-14T14:44:28+08:00","updated_at":"2025-07-14T14:44:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3922e679c4e0d8dd01b7ba95a50528a319bfb067.webp?v=1752475470","variant_ids":[43525159551075]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-YN28","featured_media":{"alt":null,"id":25816852136035,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3922e679c4e0d8dd01b7ba95a50528a319bfb067.webp?v=1752475470"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525159583843,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179508469859,"product_id":7836799598691,"position":1,"created_at":"2025-07-14T14:44:28+08:00","updated_at":"2025-07-14T14:44:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bbe83ed6057a00ef5cff62ace85a52d46d44cd2.webp?v=1752475480","variant_ids":[43525159583843]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-YN28","featured_media":{"alt":null,"id":25816851841123,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bbe83ed6057a00ef5cff62ace85a52d46d44cd2.webp?v=1752475480"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525159714915,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179504439395,"product_id":7836799598691,"position":6,"created_at":"2025-07-14T14:44:30+08:00","updated_at":"2025-07-14T14:44:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/048dd9cdbb3df44b5ce07ebff3b00dc80b826fc0.webp?v=1752475472","variant_ids":[43525159714915]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-YN28","featured_media":{"alt":null,"id":25816853315683,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/048dd9cdbb3df44b5ce07ebff3b00dc80b826fc0.webp?v=1752475472"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525159747683,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179504799843,"product_id":7836799598691,"position":8,"created_at":"2025-07-14T14:44:31+08:00","updated_at":"2025-07-14T14:44:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5d268f73c9d4b0900cd419d2e92069fefe989e4.webp?v=1752475473","variant_ids":[43525159747683]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-YN28","featured_media":{"alt":null,"id":25816853512291,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5d268f73c9d4b0900cd419d2e92069fefe989e4.webp?v=1752475473"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43525159780451,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179503390819,"product_id":7836799598691,"position":3,"created_at":"2025-07-14T14:44:29+08:00","updated_at":"2025-07-14T14:44:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9741e6bc8496004d93a4a539f70927ae65ecd566.webp?v=1752475470","variant_ids":[43525159780451]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-YN28","featured_media":{"alt":null,"id":25816852365411,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9741e6bc8496004d93a4a539f70927ae65ecd566.webp?v=1752475470"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43525159551075,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-YN28","requires_shipping":true,"taxable":true,"featured_image":{"id":34179502735459,"product_id":7836799598691,"position":2,"created_at":"2025-07-14T14:44:28+08:00","updated_at":"2025-07-14T14:44:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3922e679c4e0d8dd01b7ba95a50528a319bfb067.webp?v=1752475470","variant_ids":[43525159551075]},"available":true,"name":"iPhone 15 Pro Max SolidX OSAMU GOODS 經典復古系列-Betty - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-YN28","featured_media":{"alt":null,"id":25816852136035,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3922e679c4e0d8dd01b7ba95a50528a319bfb067.webp?v=1752475470"}},"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: "停產" }