$product = {"id":6987913068643,"title":"iPhone 13 mini SolidSuit (MagSafe 兼容) 涼丰 松果與小松鼠","handle":"iphone-13-mini-solidsuit-classic-magsafe-gd20","description":null,"published_at":"2023-08-03T02:13:35+08:00","created_at":"2023-07-30T19:47:53+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師SolidSuit專區哈利波特 Harry Potter","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-liang-feng","device-iPhone 13 Mini","merge","reseller-liang-feng"],"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":43103859671139,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0122852-GD20","requires_shipping":true,"taxable":true,"featured_image":{"id":30287554150499,"product_id":6987913068643,"position":1,"created_at":"2023-07-30T19:47:56+08:00","updated_at":"2023-07-30T19:47:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676","variant_ids":[43103859671139]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 涼丰 松果與小松鼠 - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-GD20","featured_media":{"alt":null,"id":22646263906403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0.webp?v=1784014335","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4.webp?v=1784014336","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0_fa6cfda6-1862-486f-a03b-7fd0b586d0e9.webp?v=1784018321","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4_e38638e1-11b2-49e5-a9ab-e37bbf4600e7.webp?v=1784018327","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0_10ce9691-a436-4208-ac67-aa1b85feb403.webp?v=1784018612","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4_127012f8-1080-49b5-944a-55dfe1c91559.webp?v=1784018613","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0_f3170782-517e-40b3-9fc5-dab7a5202a95.webp?v=1784018700","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4_2609a4bd-5d5f-4f32-9472-34ee0fd3ad78.webp?v=1784018705"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676","options":["color","Types"],"media":[{"alt":null,"id":22646263906403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676","width":2000},{"alt":null,"id":27761794121827,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0.webp?v=1784014335"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0.webp?v=1784014335","width":2000},{"alt":null,"id":27761794351203,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4.webp?v=1784014336"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4.webp?v=1784014336","width":2000},{"alt":null,"id":27762602016867,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0_fa6cfda6-1862-486f-a03b-7fd0b586d0e9.webp?v=1784018321"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0_fa6cfda6-1862-486f-a03b-7fd0b586d0e9.webp?v=1784018321","width":2000},{"alt":null,"id":27762602606691,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4_e38638e1-11b2-49e5-a9ab-e37bbf4600e7.webp?v=1784018327"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4_e38638e1-11b2-49e5-a9ab-e37bbf4600e7.webp?v=1784018327","width":2000},{"alt":null,"id":27762629312611,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0_10ce9691-a436-4208-ac67-aa1b85feb403.webp?v=1784018612"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0_10ce9691-a436-4208-ac67-aa1b85feb403.webp?v=1784018612","width":2000},{"alt":null,"id":27762629345379,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4_127012f8-1080-49b5-944a-55dfe1c91559.webp?v=1784018613"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4_127012f8-1080-49b5-944a-55dfe1c91559.webp?v=1784018613","width":2000},{"alt":null,"id":27762649333859,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0_f3170782-517e-40b3-9fc5-dab7a5202a95.webp?v=1784018700"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19faf68c243e47aacdfb9f2f149107dd26ae02d0_f3170782-517e-40b3-9fc5-dab7a5202a95.webp?v=1784018700","width":2000},{"alt":null,"id":27762649563235,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4_2609a4bd-5d5f-4f32-9472-34ee0fd3ad78.webp?v=1784018705"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e2d9405574ec2cf6cb28c5991a0913ffd72d5f4_2609a4bd-5d5f-4f32-9472-34ee0fd3ad78.webp?v=1784018705","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43103859671139,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0122852-GD20","requires_shipping":true,"taxable":true,"featured_image":{"id":30287554150499,"product_id":6987913068643,"position":1,"created_at":"2023-07-30T19:47:56+08:00","updated_at":"2023-07-30T19:47:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676","variant_ids":[43103859671139]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 涼丰 松果與小松鼠 - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-GD20","featured_media":{"alt":null,"id":22646263906403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43103859671139,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0122852-GD20","requires_shipping":true,"taxable":true,"featured_image":{"id":30287554150499,"product_id":6987913068643,"position":1,"created_at":"2023-07-30T19:47:56+08:00","updated_at":"2023-07-30T19:47:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676","variant_ids":[43103859671139]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 涼丰 松果與小松鼠 - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-GD20","featured_media":{"alt":null,"id":22646263906403,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-228-GD20_76613919-c01e-4171-ba2a-a08f669a4702.png?v=1690717676"}},"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: "停產" }