$product = {"id":7699833815139,"title":"iPhone 15 Pro 3D壯撞貼 PRO","handle":"iphone-15-pro-3d-screen-protector-gen2","description":null,"published_at":"2024-12-10T09:57:34+08:00","created_at":"2024-12-09T17:16:16+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"3D Impact Protector","tags":["20%","25%","30%","35%","40%","45%","50%","brand-Apple","caribou:43024590012515:3159348:1","caribou:43024590045283:3159349:1","caribou:43024590078051:3159350:1","device-iPhone 15 Pro","discountable","discountable-item","featured-product","quickbuy","reseller-3d-screen-protector-pro","screen-protector","type-3d-screen-protector-gen2-featured-product","viewable"],"price":110000,"price_min":110000,"price_max":110000,"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":43024590012515,"title":"高透","option1":"高透","option2":null,"option3":null,"sku":"IMP012974A","requires_shipping":true,"taxable":true,"featured_image":{"id":33049724158051,"product_id":7699833815139,"position":2,"created_at":"2024-12-09T17:16:20+08:00","updated_at":"2024-12-09T17:16:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cdfbf816583aeeb4eebbd156db10f1c14fe9caf.webp?v=1733735780","variant_ids":[43024590012515]},"available":true,"name":"iPhone 15 Pro 3D壯撞貼 PRO - 高透","public_title":"高透","options":["高透"],"price":110000,"weight":1100,"compare_at_price":null,"inventory_quantity":999999988,"inventory_management":null,"inventory_policy":"deny","barcode":"4711502657895","featured_media":{"alt":null,"id":25064254275683,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cdfbf816583aeeb4eebbd156db10f1c14fe9caf.webp?v=1733735780"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43024590045283,"title":"防窺","option1":"防窺","option2":null,"option3":null,"sku":"IMP012974B","requires_shipping":true,"taxable":true,"featured_image":{"id":33049724846179,"product_id":7699833815139,"position":3,"created_at":"2024-12-09T17:16:22+08:00","updated_at":"2024-12-09T17:16:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3639edfd58c5964a801a9ca83ec4dff4fa2e62cc.webp?v=1733735782","variant_ids":[43024590045283]},"available":true,"name":"iPhone 15 Pro 3D壯撞貼 PRO - 防窺","public_title":"防窺","options":["防窺"],"price":110000,"weight":1100,"compare_at_price":null,"inventory_quantity":999999989,"inventory_management":null,"inventory_policy":"deny","barcode":"4711502657901","featured_media":{"alt":null,"id":25064254505059,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3639edfd58c5964a801a9ca83ec4dff4fa2e62cc.webp?v=1733735782"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43024590078051,"title":"霧面","option1":"霧面","option2":null,"option3":null,"sku":"IMP012974C","requires_shipping":true,"taxable":true,"featured_image":{"id":33049723142243,"product_id":7699833815139,"position":1,"created_at":"2024-12-09T17:16:18+08:00","updated_at":"2024-12-09T17:16:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e9348f278d9f12cbf169b7d56492a05fcf58f1d.webp?v=1733735778","variant_ids":[43024590078051]},"available":true,"name":"iPhone 15 Pro 3D壯撞貼 PRO - 霧面","public_title":"霧面","options":["霧面"],"price":110000,"weight":1100,"compare_at_price":null,"inventory_quantity":999999989,"inventory_management":null,"inventory_policy":"deny","barcode":"4711502657918","featured_media":{"alt":null,"id":25064253423715,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e9348f278d9f12cbf169b7d56492a05fcf58f1d.webp?v=1733735778"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e9348f278d9f12cbf169b7d56492a05fcf58f1d.webp?v=1733735778","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cdfbf816583aeeb4eebbd156db10f1c14fe9caf.webp?v=1733735780","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3639edfd58c5964a801a9ca83ec4dff4fa2e62cc.webp?v=1733735782"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e9348f278d9f12cbf169b7d56492a05fcf58f1d.webp?v=1733735778","options":["color"],"media":[{"alt":null,"id":25064253423715,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e9348f278d9f12cbf169b7d56492a05fcf58f1d.webp?v=1733735778"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e9348f278d9f12cbf169b7d56492a05fcf58f1d.webp?v=1733735778","width":2000},{"alt":null,"id":25064254275683,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cdfbf816583aeeb4eebbd156db10f1c14fe9caf.webp?v=1733735780"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cdfbf816583aeeb4eebbd156db10f1c14fe9caf.webp?v=1733735780","width":2000},{"alt":null,"id":25064254505059,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3639edfd58c5964a801a9ca83ec4dff4fa2e62cc.webp?v=1733735782"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3639edfd58c5964a801a9ca83ec4dff4fa2e62cc.webp?v=1733735782","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43024590012515,"title":"高透","option1":"高透","option2":null,"option3":null,"sku":"IMP012974A","requires_shipping":true,"taxable":true,"featured_image":{"id":33049724158051,"product_id":7699833815139,"position":2,"created_at":"2024-12-09T17:16:20+08:00","updated_at":"2024-12-09T17:16:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cdfbf816583aeeb4eebbd156db10f1c14fe9caf.webp?v=1733735780","variant_ids":[43024590012515]},"available":true,"name":"iPhone 15 Pro 3D壯撞貼 PRO - 高透","public_title":"高透","options":["高透"],"price":110000,"weight":1100,"compare_at_price":null,"inventory_quantity":999999988,"inventory_management":null,"inventory_policy":"deny","barcode":"4711502657895","featured_media":{"alt":null,"id":25064254275683,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cdfbf816583aeeb4eebbd156db10f1c14fe9caf.webp?v=1733735780"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43024590045283,"title":"防窺","option1":"防窺","option2":null,"option3":null,"sku":"IMP012974B","requires_shipping":true,"taxable":true,"featured_image":{"id":33049724846179,"product_id":7699833815139,"position":3,"created_at":"2024-12-09T17:16:22+08:00","updated_at":"2024-12-09T17:16:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3639edfd58c5964a801a9ca83ec4dff4fa2e62cc.webp?v=1733735782","variant_ids":[43024590045283]},"available":true,"name":"iPhone 15 Pro 3D壯撞貼 PRO - 防窺","public_title":"防窺","options":["防窺"],"price":110000,"weight":1100,"compare_at_price":null,"inventory_quantity":999999989,"inventory_management":null,"inventory_policy":"deny","barcode":"4711502657901","featured_media":{"alt":null,"id":25064254505059,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3639edfd58c5964a801a9ca83ec4dff4fa2e62cc.webp?v=1733735782"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43024590078051,"title":"霧面","option1":"霧面","option2":null,"option3":null,"sku":"IMP012974C","requires_shipping":true,"taxable":true,"featured_image":{"id":33049723142243,"product_id":7699833815139,"position":1,"created_at":"2024-12-09T17:16:18+08:00","updated_at":"2024-12-09T17:16:18+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e9348f278d9f12cbf169b7d56492a05fcf58f1d.webp?v=1733735778","variant_ids":[43024590078051]},"available":true,"name":"iPhone 15 Pro 3D壯撞貼 PRO - 霧面","public_title":"霧面","options":["霧面"],"price":110000,"weight":1100,"compare_at_price":null,"inventory_quantity":999999989,"inventory_management":null,"inventory_policy":"deny","barcode":"4711502657918","featured_media":{"alt":null,"id":25064253423715,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e9348f278d9f12cbf169b7d56492a05fcf58f1d.webp?v=1733735778"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43024590012515,"title":"高透","option1":"高透","option2":null,"option3":null,"sku":"IMP012974A","requires_shipping":true,"taxable":true,"featured_image":{"id":33049724158051,"product_id":7699833815139,"position":2,"created_at":"2024-12-09T17:16:20+08:00","updated_at":"2024-12-09T17:16:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cdfbf816583aeeb4eebbd156db10f1c14fe9caf.webp?v=1733735780","variant_ids":[43024590012515]},"available":true,"name":"iPhone 15 Pro 3D壯撞貼 PRO - 高透","public_title":"高透","options":["高透"],"price":110000,"weight":1100,"compare_at_price":null,"inventory_quantity":999999988,"inventory_management":null,"inventory_policy":"deny","barcode":"4711502657895","featured_media":{"alt":null,"id":25064254275683,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cdfbf816583aeeb4eebbd156db10f1c14fe9caf.webp?v=1733735780"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; var sellingStatus; $device_handle = null if ($bumper) { $(document).ready(function() { var productImg = $product.images[0] var bumperVariants = $bumper.variants; var bumperColors = new Object(); var currentVariant = ''; var productType = ''; bumperVariants.forEach(variant => { bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src; }); if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') { mergeImages([productImg, bumperColors[currentVariant]],{ crossOrigin: 'anonymous' }) .then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } else { mergeImages([bumperColors[currentVariant], productImg],{ crossOrigin: 'anonymous' }) .then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } }); }; var storedData = sessionStorage.getItem('sellingStatusData'); try { sellingStatusData = JSON.parse(storedData) } catch (error) { console.error('JSON.parse Error', error) sellingStatusData = null } $(document).ready(function() { handleSellingStatus($defaultVariant.sku, sellingStatusData); }); function handleSellingStatus(currentSku, sellingStatusData) { const sellingStatusElement = document.getElementById('selling-status') const addToCartButton = document.getElementById('AddToCart-product-template') const currentProductSku = currentSku.replace(/-(.*)$/, '-') if ($variants) { const matchSellingStatusProduct = sellingStatusData.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, sellingStatusData) }); });
// 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: "停產" }