$product = {"id":7949632241763,"title":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆","handle":"iphone-15-pro-solidx-za07","description":null,"published_at":"2026-01-12T09:12:02+08:00","created_at":"2026-01-07T09:46:07+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-disney-wdas","device-iPhone 15 Pro","merge","reseller-disney-wdas"],"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":43938867118179,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074032730211,"product_id":7949632241763,"position":9,"created_at":"2026-01-07T09:46:55+08:00","updated_at":"2026-01-07T09:46:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53c07f2adf4bdd678fb4bf469e684e7ba6478b3f.webp?v=1767750417","variant_ids":[43938867118179]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - 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":"NST012970B-ZA07","featured_media":{"alt":null,"id":26631443677283,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53c07f2adf4bdd678fb4bf469e684e7ba6478b3f.webp?v=1767750417"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43938867806307,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074032140387,"product_id":7949632241763,"position":7,"created_at":"2026-01-07T09:46:53+08:00","updated_at":"2026-01-07T09:46:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d6f4c981aa1cc68055a34714dc72b8bd290fa9.webp?v=1767750416","variant_ids":[43938867806307]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - 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":"NST012970A-ZA07","featured_media":{"alt":null,"id":26631443087459,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d6f4c981aa1cc68055a34714dc72b8bd290fa9.webp?v=1767750416"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43938868723811,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074031878243,"product_id":7949632241763,"position":6,"created_at":"2026-01-07T09:46:53+08:00","updated_at":"2026-01-07T09:46:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dcdf34e4db2bb67b48dfebd5e50c0d87c6c341f1.webp?v=1767750415","variant_ids":[43938868723811]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - 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":"NST01297Z8-ZA07","featured_media":{"alt":null,"id":26631442792547,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dcdf34e4db2bb67b48dfebd5e50c0d87c6c341f1.webp?v=1767750415"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43938869772387,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074032959587,"product_id":7949632241763,"position":10,"created_at":"2026-01-07T09:46:55+08:00","updated_at":"2026-01-07T09:46:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/910296bf49594ed34475607794d02450ac003638.webp?v=1767750417","variant_ids":[43938869772387]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-ZA07","featured_media":{"alt":null,"id":26631443939427,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/910296bf49594ed34475607794d02450ac003638.webp?v=1767750417"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43938870558819,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074031452259,"product_id":7949632241763,"position":5,"created_at":"2026-01-07T09:46:52+08:00","updated_at":"2026-01-07T09:46:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6baee1cf815999dca7c358b1e7940f3646da022d.webp?v=1767750414","variant_ids":[43938870558819]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-ZA07","featured_media":{"alt":null,"id":26631442399331,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6baee1cf815999dca7c358b1e7940f3646da022d.webp?v=1767750414"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/65d749a4b82778a9c016f421a1a2989fcdfb6a2c.webp?v=1767750413","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d76718936707a8bd2caf6bbc99e7776a0b82386.webp?v=1767750413","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2bc3108f3e4d842819c0251e4605519c62ed8ff5.webp?v=1767750413","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1aebb375f0bbc2dcbfce628f8b0109d5179fd348.webp?v=1767750414","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6baee1cf815999dca7c358b1e7940f3646da022d.webp?v=1767750414","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dcdf34e4db2bb67b48dfebd5e50c0d87c6c341f1.webp?v=1767750415","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d6f4c981aa1cc68055a34714dc72b8bd290fa9.webp?v=1767750416","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d4240a1db1d6ef346b1326a1a6d2850fe4a0bd.webp?v=1767750416","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53c07f2adf4bdd678fb4bf469e684e7ba6478b3f.webp?v=1767750417","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/910296bf49594ed34475607794d02450ac003638.webp?v=1767750417"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/65d749a4b82778a9c016f421a1a2989fcdfb6a2c.webp?v=1767750413","options":["color"],"media":[{"alt":null,"id":26631440826467,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/65d749a4b82778a9c016f421a1a2989fcdfb6a2c.webp?v=1767750413"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/65d749a4b82778a9c016f421a1a2989fcdfb6a2c.webp?v=1767750413","width":2000},{"alt":null,"id":26631441154147,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d76718936707a8bd2caf6bbc99e7776a0b82386.webp?v=1767750413"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d76718936707a8bd2caf6bbc99e7776a0b82386.webp?v=1767750413","width":2000},{"alt":null,"id":26631441645667,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2bc3108f3e4d842819c0251e4605519c62ed8ff5.webp?v=1767750413"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2bc3108f3e4d842819c0251e4605519c62ed8ff5.webp?v=1767750413","width":2000},{"alt":null,"id":26631441907811,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1aebb375f0bbc2dcbfce628f8b0109d5179fd348.webp?v=1767750414"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1aebb375f0bbc2dcbfce628f8b0109d5179fd348.webp?v=1767750414","width":2000},{"alt":null,"id":26631442399331,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6baee1cf815999dca7c358b1e7940f3646da022d.webp?v=1767750414"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6baee1cf815999dca7c358b1e7940f3646da022d.webp?v=1767750414","width":2000},{"alt":null,"id":26631442792547,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dcdf34e4db2bb67b48dfebd5e50c0d87c6c341f1.webp?v=1767750415"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dcdf34e4db2bb67b48dfebd5e50c0d87c6c341f1.webp?v=1767750415","width":2000},{"alt":null,"id":26631443087459,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d6f4c981aa1cc68055a34714dc72b8bd290fa9.webp?v=1767750416"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d6f4c981aa1cc68055a34714dc72b8bd290fa9.webp?v=1767750416","width":2000},{"alt":null,"id":26631443316835,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d4240a1db1d6ef346b1326a1a6d2850fe4a0bd.webp?v=1767750416"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d4240a1db1d6ef346b1326a1a6d2850fe4a0bd.webp?v=1767750416","width":2000},{"alt":null,"id":26631443677283,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53c07f2adf4bdd678fb4bf469e684e7ba6478b3f.webp?v=1767750417"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53c07f2adf4bdd678fb4bf469e684e7ba6478b3f.webp?v=1767750417","width":2000},{"alt":null,"id":26631443939427,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/910296bf49594ed34475607794d02450ac003638.webp?v=1767750417"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/910296bf49594ed34475607794d02450ac003638.webp?v=1767750417","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43938867118179,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074032730211,"product_id":7949632241763,"position":9,"created_at":"2026-01-07T09:46:55+08:00","updated_at":"2026-01-07T09:46:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53c07f2adf4bdd678fb4bf469e684e7ba6478b3f.webp?v=1767750417","variant_ids":[43938867118179]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - 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":"NST012970B-ZA07","featured_media":{"alt":null,"id":26631443677283,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53c07f2adf4bdd678fb4bf469e684e7ba6478b3f.webp?v=1767750417"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43938867806307,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074032140387,"product_id":7949632241763,"position":7,"created_at":"2026-01-07T09:46:53+08:00","updated_at":"2026-01-07T09:46:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d6f4c981aa1cc68055a34714dc72b8bd290fa9.webp?v=1767750416","variant_ids":[43938867806307]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - 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":"NST012970A-ZA07","featured_media":{"alt":null,"id":26631443087459,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d6f4c981aa1cc68055a34714dc72b8bd290fa9.webp?v=1767750416"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43938868723811,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074031878243,"product_id":7949632241763,"position":6,"created_at":"2026-01-07T09:46:53+08:00","updated_at":"2026-01-07T09:46:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dcdf34e4db2bb67b48dfebd5e50c0d87c6c341f1.webp?v=1767750415","variant_ids":[43938868723811]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - 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":"NST01297Z8-ZA07","featured_media":{"alt":null,"id":26631442792547,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dcdf34e4db2bb67b48dfebd5e50c0d87c6c341f1.webp?v=1767750415"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43938869772387,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074032959587,"product_id":7949632241763,"position":10,"created_at":"2026-01-07T09:46:55+08:00","updated_at":"2026-01-07T09:46:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/910296bf49594ed34475607794d02450ac003638.webp?v=1767750417","variant_ids":[43938869772387]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-ZA07","featured_media":{"alt":null,"id":26631443939427,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/910296bf49594ed34475607794d02450ac003638.webp?v=1767750417"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43938870558819,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074031452259,"product_id":7949632241763,"position":5,"created_at":"2026-01-07T09:46:52+08:00","updated_at":"2026-01-07T09:46:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6baee1cf815999dca7c358b1e7940f3646da022d.webp?v=1767750414","variant_ids":[43938870558819]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-ZA07","featured_media":{"alt":null,"id":26631442399331,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6baee1cf815999dca7c358b1e7940f3646da022d.webp?v=1767750414"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43938867118179,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-ZA07","requires_shipping":true,"taxable":true,"featured_image":{"id":35074032730211,"product_id":7949632241763,"position":9,"created_at":"2026-01-07T09:46:55+08:00","updated_at":"2026-01-07T09:46:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53c07f2adf4bdd678fb4bf469e684e7ba6478b3f.webp?v=1767750417","variant_ids":[43938867118179]},"available":true,"name":"iPhone 15 Pro SolidX 動物方城市 | 大英雄天團 | 魔法滿屋 動物方城市 - Yax 放鬆 - 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":"NST012970B-ZA07","featured_media":{"alt":null,"id":26631443677283,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53c07f2adf4bdd678fb4bf469e684e7ba6478b3f.webp?v=1767750417"}},"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: "停產" }