$product = {"id":7994655801443,"title":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴","handle":"iphone-12-mini-solidsuit-classic-magsafe-kit110","description":null,"published_at":"2026-04-13T15:01:27+08:00","created_at":"2026-04-13T11:49:01+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-hello-kitty","device-iPhone 12 Mini","merge","reseller-hello-kitty"],"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":44113095098467,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011840E-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636340916323,"product_id":7994655801443,"position":4,"created_at":"2026-04-13T11:49:29+08:00","updated_at":"2026-04-13T11:49:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/adefd11005ad93a209ea2565343862911fe6fad9.webp?v=1776052171","variant_ids":[44113095098467]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840E-KIT110","featured_media":{"alt":null,"id":27165481664611,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/adefd11005ad93a209ea2565343862911fe6fad9.webp?v=1776052171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113107091555,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST011840D-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636341506147,"product_id":7994655801443,"position":6,"created_at":"2026-04-13T11:49:30+08:00","updated_at":"2026-04-13T11:49:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8c4639d6d630c246375a7751fb3f23c3463452.webp?v=1776052172","variant_ids":[44113107091555]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840D-KIT110","featured_media":{"alt":null,"id":27165482221667,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8c4639d6d630c246375a7751fb3f23c3463452.webp?v=1776052172"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113107484771,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MST011840A-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636341211235,"product_id":7994655801443,"position":5,"created_at":"2026-04-13T11:49:29+08:00","updated_at":"2026-04-13T11:49:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08db83313bde9a070d195b23521621819dbad29f.webp?v=1776052171","variant_ids":[44113107484771]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840A-KIT110","featured_media":{"alt":null,"id":27165481926755,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08db83313bde9a070d195b23521621819dbad29f.webp?v=1776052171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113107910755,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"MST01184Z9-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636341768291,"product_id":7994655801443,"position":7,"created_at":"2026-04-13T11:49:30+08:00","updated_at":"2026-04-13T11:49:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/421baadb8dde7a5369f7571109d46f3b6b0cea3d.webp?v=1776052172","variant_ids":[44113107910755]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - 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":"MST01184Z9-KIT110","featured_media":{"alt":null,"id":27165482483811,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/421baadb8dde7a5369f7571109d46f3b6b0cea3d.webp?v=1776052172"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113108205667,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"MST01184Z8-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636340326499,"product_id":7994655801443,"position":1,"created_at":"2026-04-13T11:49:27+08:00","updated_at":"2026-04-13T11:49:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e953d42e7bfc3a34bc435b13928057820252d27b.webp?v=1776052169","variant_ids":[44113108205667]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01184Z8-KIT110","featured_media":{"alt":null,"id":27165481042019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e953d42e7bfc3a34bc435b13928057820252d27b.webp?v=1776052169"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113108467811,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118452-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636340555875,"product_id":7994655801443,"position":2,"created_at":"2026-04-13T11:49:28+08:00","updated_at":"2026-04-13T11:49:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b700e794da0c2372467c1f42bd308f7c8ec25c4.webp?v=1776052170","variant_ids":[44113108467811]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118452-KIT110","featured_media":{"alt":null,"id":27165481205859,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b700e794da0c2372467c1f42bd308f7c8ec25c4.webp?v=1776052170"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e953d42e7bfc3a34bc435b13928057820252d27b.webp?v=1776052169","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b700e794da0c2372467c1f42bd308f7c8ec25c4.webp?v=1776052170","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/446bd69a69993e8e85f0ca0dcd8b3d1da0af7d24.webp?v=1776052170","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/adefd11005ad93a209ea2565343862911fe6fad9.webp?v=1776052171","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08db83313bde9a070d195b23521621819dbad29f.webp?v=1776052171","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8c4639d6d630c246375a7751fb3f23c3463452.webp?v=1776052172","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/421baadb8dde7a5369f7571109d46f3b6b0cea3d.webp?v=1776052172"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e953d42e7bfc3a34bc435b13928057820252d27b.webp?v=1776052169","options":["color"],"media":[{"alt":null,"id":27165481042019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e953d42e7bfc3a34bc435b13928057820252d27b.webp?v=1776052169"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e953d42e7bfc3a34bc435b13928057820252d27b.webp?v=1776052169","width":2000},{"alt":null,"id":27165481205859,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b700e794da0c2372467c1f42bd308f7c8ec25c4.webp?v=1776052170"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b700e794da0c2372467c1f42bd308f7c8ec25c4.webp?v=1776052170","width":2000},{"alt":null,"id":27165481435235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/446bd69a69993e8e85f0ca0dcd8b3d1da0af7d24.webp?v=1776052170"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/446bd69a69993e8e85f0ca0dcd8b3d1da0af7d24.webp?v=1776052170","width":2000},{"alt":null,"id":27165481664611,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/adefd11005ad93a209ea2565343862911fe6fad9.webp?v=1776052171"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/adefd11005ad93a209ea2565343862911fe6fad9.webp?v=1776052171","width":2000},{"alt":null,"id":27165481926755,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08db83313bde9a070d195b23521621819dbad29f.webp?v=1776052171"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08db83313bde9a070d195b23521621819dbad29f.webp?v=1776052171","width":2000},{"alt":null,"id":27165482221667,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8c4639d6d630c246375a7751fb3f23c3463452.webp?v=1776052172"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8c4639d6d630c246375a7751fb3f23c3463452.webp?v=1776052172","width":2000},{"alt":null,"id":27165482483811,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/421baadb8dde7a5369f7571109d46f3b6b0cea3d.webp?v=1776052172"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/421baadb8dde7a5369f7571109d46f3b6b0cea3d.webp?v=1776052172","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":44113095098467,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011840E-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636340916323,"product_id":7994655801443,"position":4,"created_at":"2026-04-13T11:49:29+08:00","updated_at":"2026-04-13T11:49:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/adefd11005ad93a209ea2565343862911fe6fad9.webp?v=1776052171","variant_ids":[44113095098467]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840E-KIT110","featured_media":{"alt":null,"id":27165481664611,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/adefd11005ad93a209ea2565343862911fe6fad9.webp?v=1776052171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113107091555,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST011840D-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636341506147,"product_id":7994655801443,"position":6,"created_at":"2026-04-13T11:49:30+08:00","updated_at":"2026-04-13T11:49:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8c4639d6d630c246375a7751fb3f23c3463452.webp?v=1776052172","variant_ids":[44113107091555]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840D-KIT110","featured_media":{"alt":null,"id":27165482221667,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8c4639d6d630c246375a7751fb3f23c3463452.webp?v=1776052172"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113107484771,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"MST011840A-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636341211235,"product_id":7994655801443,"position":5,"created_at":"2026-04-13T11:49:29+08:00","updated_at":"2026-04-13T11:49:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08db83313bde9a070d195b23521621819dbad29f.webp?v=1776052171","variant_ids":[44113107484771]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840A-KIT110","featured_media":{"alt":null,"id":27165481926755,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/08db83313bde9a070d195b23521621819dbad29f.webp?v=1776052171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113107910755,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"MST01184Z9-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636341768291,"product_id":7994655801443,"position":7,"created_at":"2026-04-13T11:49:30+08:00","updated_at":"2026-04-13T11:49:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/421baadb8dde7a5369f7571109d46f3b6b0cea3d.webp?v=1776052172","variant_ids":[44113107910755]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - 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":"MST01184Z9-KIT110","featured_media":{"alt":null,"id":27165482483811,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/421baadb8dde7a5369f7571109d46f3b6b0cea3d.webp?v=1776052172"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113108205667,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"MST01184Z8-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636340326499,"product_id":7994655801443,"position":1,"created_at":"2026-04-13T11:49:27+08:00","updated_at":"2026-04-13T11:49:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e953d42e7bfc3a34bc435b13928057820252d27b.webp?v=1776052169","variant_ids":[44113108205667]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01184Z8-KIT110","featured_media":{"alt":null,"id":27165481042019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e953d42e7bfc3a34bc435b13928057820252d27b.webp?v=1776052169"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44113108467811,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118452-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636340555875,"product_id":7994655801443,"position":2,"created_at":"2026-04-13T11:49:28+08:00","updated_at":"2026-04-13T11:49:30+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b700e794da0c2372467c1f42bd308f7c8ec25c4.webp?v=1776052170","variant_ids":[44113108467811]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118452-KIT110","featured_media":{"alt":null,"id":27165481205859,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2b700e794da0c2372467c1f42bd308f7c8ec25c4.webp?v=1776052170"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":44113095098467,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011840E-KIT110","requires_shipping":true,"taxable":true,"featured_image":{"id":35636340916323,"product_id":7994655801443,"position":4,"created_at":"2026-04-13T11:49:29+08:00","updated_at":"2026-04-13T11:49:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/adefd11005ad93a209ea2565343862911fe6fad9.webp?v=1776052171","variant_ids":[44113095098467]},"available":true,"name":"iPhone 12 mini SolidSuit (MagSafe 兼容) Hello Kitty 豹抱小夥伴 - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011840E-KIT110","featured_media":{"alt":null,"id":27165481664611,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/adefd11005ad93a209ea2565343862911fe6fad9.webp?v=1776052171"}},"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: "停產" }