$product = {"id":7920473899107,"title":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-七海建人","handle":"iphone-15-plus-solidx-ptt15","description":null,"published_at":"2025-11-10T16:42:08+08:00","created_at":"2025-11-10T14:52:41+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jujutsu-kaisen","device-iPhone 15 Plus","merge","reseller-jujutsu-kaisen"],"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":43828705263715,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT15","requires_shipping":true,"taxable":true,"featured_image":{"id":36125154902115,"product_id":7920473899107,"position":17,"created_at":"2026-06-29T15:42:51+08:00","updated_at":"2026-06-29T15:42:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_723ca4ec-f45a-466c-b3cf-f72035bb80d7.webp?v=1782718973","variant_ids":[43828705263715]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-七海建人 - 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":"NST012960B-PTT15","featured_media":{"alt":null,"id":27630397653091,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_723ca4ec-f45a-466c-b3cf-f72035bb80d7.webp?v=1782718973"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828711620707,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT15","requires_shipping":true,"taxable":true,"featured_image":{"id":36125155033187,"product_id":7920473899107,"position":18,"created_at":"2026-06-29T15:42:51+08:00","updated_at":"2026-06-29T15:42:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_f7bf19c0-60d4-4ec5-9984-dbf1574b682b.webp?v=1782718974","variant_ids":[43828711620707]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-七海建人 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129652-PTT15","featured_media":{"alt":null,"id":27630397784163,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_f7bf19c0-60d4-4ec5-9984-dbf1574b682b.webp?v=1782718974"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d.webp?v=1762757568","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc.webp?v=1762757569","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a136d7a7a6777d6bcf99792f364afa42fd6d2b57.webp?v=1762757570","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bd440c6e176e3c0ca0cc5875235af192b49fdef.webp?v=1762757570","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de28c6d3c913beaad61f9191626cb37096f31f32.webp?v=1762757571","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d9d71657cb2e8a316c6431d7998e9335da0687dc.webp?v=1762757572","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfff2febe04bbaca4c321281a0d6952ca95d09a6.webp?v=1762757572","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c89af8af29ebd105a0b5249d1a0471aac354016e.webp?v=1762757573","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb.webp?v=1762757574","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4207649d7d0f0f14d11bdaa1447ce005289e7f63.webp?v=1762757574","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_3ae0a601-b57f-40df-902c-58ab337470b8.webp?v=1782266143","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_e6708649-90c0-4b6a-a241-e33d71c80518.webp?v=1782266144","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc_4fbfcbb1-4604-48e0-ae5d-6390db084daf.webp?v=1782266145","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_c4be3c51-4004-479d-83a3-566744def224.webp?v=1782291743","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_5cb77842-40d8-465b-af3b-52afeb2b4de7.webp?v=1782291744","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc_0fcbcabc-51f4-4380-8dc5-9a7f05029e2d.webp?v=1782291746","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_723ca4ec-f45a-466c-b3cf-f72035bb80d7.webp?v=1782718973","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_f7bf19c0-60d4-4ec5-9984-dbf1574b682b.webp?v=1782718974","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc_ff49f3b8-4f11-4bd4-afa5-852ca4e7533b.webp?v=1782718974"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d.webp?v=1762757568","options":["color"],"media":[{"alt":null,"id":26347632918627,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d.webp?v=1762757568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d.webp?v=1762757568","width":2000},{"alt":null,"id":26347633180771,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc.webp?v=1762757569"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc.webp?v=1762757569","width":2000},{"alt":null,"id":26347633541219,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a136d7a7a6777d6bcf99792f364afa42fd6d2b57.webp?v=1762757570"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a136d7a7a6777d6bcf99792f364afa42fd6d2b57.webp?v=1762757570","width":2000},{"alt":null,"id":26347633770595,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bd440c6e176e3c0ca0cc5875235af192b49fdef.webp?v=1762757570"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bd440c6e176e3c0ca0cc5875235af192b49fdef.webp?v=1762757570","width":2000},{"alt":null,"id":26347634098275,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de28c6d3c913beaad61f9191626cb37096f31f32.webp?v=1762757571"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de28c6d3c913beaad61f9191626cb37096f31f32.webp?v=1762757571","width":2000},{"alt":null,"id":26347634425955,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d9d71657cb2e8a316c6431d7998e9335da0687dc.webp?v=1762757572"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d9d71657cb2e8a316c6431d7998e9335da0687dc.webp?v=1762757572","width":2000},{"alt":null,"id":26347634720867,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfff2febe04bbaca4c321281a0d6952ca95d09a6.webp?v=1762757572"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfff2febe04bbaca4c321281a0d6952ca95d09a6.webp?v=1762757572","width":2000},{"alt":null,"id":26347635081315,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c89af8af29ebd105a0b5249d1a0471aac354016e.webp?v=1762757573"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c89af8af29ebd105a0b5249d1a0471aac354016e.webp?v=1762757573","width":2000},{"alt":null,"id":26347635376227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb.webp?v=1762757574"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb.webp?v=1762757574","width":2000},{"alt":null,"id":26347635736675,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4207649d7d0f0f14d11bdaa1447ce005289e7f63.webp?v=1762757574"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4207649d7d0f0f14d11bdaa1447ce005289e7f63.webp?v=1762757574","width":2000},{"alt":null,"id":27587411640419,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_3ae0a601-b57f-40df-902c-58ab337470b8.webp?v=1782266143"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_3ae0a601-b57f-40df-902c-58ab337470b8.webp?v=1782266143","width":2000},{"alt":null,"id":27587412000867,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_e6708649-90c0-4b6a-a241-e33d71c80518.webp?v=1782266144"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_e6708649-90c0-4b6a-a241-e33d71c80518.webp?v=1782266144","width":2000},{"alt":null,"id":27587412590691,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc_4fbfcbb1-4604-48e0-ae5d-6390db084daf.webp?v=1782266145"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc_4fbfcbb1-4604-48e0-ae5d-6390db084daf.webp?v=1782266145","width":2000},{"alt":null,"id":27594719821923,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_c4be3c51-4004-479d-83a3-566744def224.webp?v=1782291743"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_c4be3c51-4004-479d-83a3-566744def224.webp?v=1782291743","width":2000},{"alt":null,"id":27594720804963,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_5cb77842-40d8-465b-af3b-52afeb2b4de7.webp?v=1782291744"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_5cb77842-40d8-465b-af3b-52afeb2b4de7.webp?v=1782291744","width":2000},{"alt":null,"id":27594720968803,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc_0fcbcabc-51f4-4380-8dc5-9a7f05029e2d.webp?v=1782291746"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc_0fcbcabc-51f4-4380-8dc5-9a7f05029e2d.webp?v=1782291746","width":2000},{"alt":null,"id":27630397653091,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_723ca4ec-f45a-466c-b3cf-f72035bb80d7.webp?v=1782718973"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_723ca4ec-f45a-466c-b3cf-f72035bb80d7.webp?v=1782718973","width":2000},{"alt":null,"id":27630397784163,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_f7bf19c0-60d4-4ec5-9984-dbf1574b682b.webp?v=1782718974"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_f7bf19c0-60d4-4ec5-9984-dbf1574b682b.webp?v=1782718974","width":2000},{"alt":null,"id":27630398013539,"position":19,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc_ff49f3b8-4f11-4bd4-afa5-852ca4e7533b.webp?v=1782718974"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f40568a89c6bd3e28dfb38f635540f00b0130cdc_ff49f3b8-4f11-4bd4-afa5-852ca4e7533b.webp?v=1782718974","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43828705263715,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT15","requires_shipping":true,"taxable":true,"featured_image":{"id":36125154902115,"product_id":7920473899107,"position":17,"created_at":"2026-06-29T15:42:51+08:00","updated_at":"2026-06-29T15:42:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_723ca4ec-f45a-466c-b3cf-f72035bb80d7.webp?v=1782718973","variant_ids":[43828705263715]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-七海建人 - 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":"NST012960B-PTT15","featured_media":{"alt":null,"id":27630397653091,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_723ca4ec-f45a-466c-b3cf-f72035bb80d7.webp?v=1782718973"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828711620707,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT15","requires_shipping":true,"taxable":true,"featured_image":{"id":36125155033187,"product_id":7920473899107,"position":18,"created_at":"2026-06-29T15:42:51+08:00","updated_at":"2026-06-29T15:42:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_f7bf19c0-60d4-4ec5-9984-dbf1574b682b.webp?v=1782718974","variant_ids":[43828711620707]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-七海建人 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129652-PTT15","featured_media":{"alt":null,"id":27630397784163,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bdb245375c042fa3b7a5ef5c52b6de0263784c2d_f7bf19c0-60d4-4ec5-9984-dbf1574b682b.webp?v=1782718974"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43828705263715,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT15","requires_shipping":true,"taxable":true,"featured_image":{"id":36125154902115,"product_id":7920473899107,"position":17,"created_at":"2026-06-29T15:42:51+08:00","updated_at":"2026-06-29T15:42:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_723ca4ec-f45a-466c-b3cf-f72035bb80d7.webp?v=1782718973","variant_ids":[43828705263715]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-七海建人 - 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":"NST012960B-PTT15","featured_media":{"alt":null,"id":27630397653091,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9528dbb19075636b64acdc92192036d0d6df6ebb_723ca4ec-f45a-466c-b3cf-f72035bb80d7.webp?v=1782718973"}},"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: "停產" }