$product = {"id":6986482384995,"title":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile","handle":"iphone-12-pro-solidsuit-classic-ea24","description":null,"published_at":"2023-08-03T01:10:55+08:00","created_at":"2023-07-29T19:39:24+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-songsongmeow","device-iPhone 12 Pro","merge","reseller-songsongmeow"],"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":40611215540323,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118552-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210796527715,"product_id":6986482384995,"position":7,"created_at":"2026-07-08T16:16:35+08:00","updated_at":"2026-07-08T16:16:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2915d0157956450c9354969f25b786585c041479.webp?v=1783498598","variant_ids":[40611215540323]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - Black","public_title":"Black","options":["Black"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118552-EA24","featured_media":{"alt":null,"id":27715591503971,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2915d0157956450c9354969f25b786585c041479.webp?v=1783498598"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40611215573091,"title":"White","option1":"White","option2":null,"option3":null,"sku":"SST0118553-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210793807971,"product_id":6986482384995,"position":3,"created_at":"2026-07-08T16:16:33+08:00","updated_at":"2026-07-08T16:16:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77e425e58775a9f7dd3a4fcf94037eaecad12f68.webp?v=1783498595","variant_ids":[40611215573091]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - White","public_title":"White","options":["White"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118553-EA24","featured_media":{"alt":null,"id":27715588816995,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77e425e58775a9f7dd3a4fcf94037eaecad12f68.webp?v=1783498595"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40611215802467,"title":"Sage Green","option1":"Sage Green","option2":null,"option3":null,"sku":"SST01185P2-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210795577443,"product_id":6986482384995,"position":5,"created_at":"2026-07-08T16:16:34+08:00","updated_at":"2026-07-08T16:16:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/16258fc17f594817a90029b8175222c208facdb7.webp?v=1783498596","variant_ids":[40611215802467]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - Sage Green","public_title":"Sage Green","options":["Sage Green"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01185P2-EA24","featured_media":{"alt":null,"id":27715590127715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/16258fc17f594817a90029b8175222c208facdb7.webp?v=1783498596"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40700825632867,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"SST011850A-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210796003427,"product_id":6986482384995,"position":6,"created_at":"2026-07-08T16:16:35+08:00","updated_at":"2026-07-08T16:16:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b175a4cfc6aa14a728a5d8e9094daef674c32e0.webp?v=1783498597","variant_ids":[40700825632867]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011850A-EA24","featured_media":{"alt":null,"id":27715591012451,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b175a4cfc6aa14a728a5d8e9094daef674c32e0.webp?v=1783498597"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40671596347491,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011850B-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210799050851,"product_id":6986482384995,"position":9,"created_at":"2026-07-08T16:16:37+08:00","updated_at":"2026-07-08T16:16:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55768d4e4bab39d2239778d22978d14e7687aa12.webp?v=1783498599","variant_ids":[40671596347491]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011850B-EA24","featured_media":{"alt":null,"id":27715594027107,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55768d4e4bab39d2239778d22978d14e7687aa12.webp?v=1783498599"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-185-EA24_1d092c9f-7a69-4331-a54b-5e9d96a7d250.png?v=1690634926","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef74cacf815ed5ab8f09ab070ff0cc5fa282e1a.webp?v=1783498594","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77e425e58775a9f7dd3a4fcf94037eaecad12f68.webp?v=1783498595","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/091aa8cbfaed8b5adb6b03438a2c0ecde4297542.webp?v=1783498595","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/16258fc17f594817a90029b8175222c208facdb7.webp?v=1783498596","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b175a4cfc6aa14a728a5d8e9094daef674c32e0.webp?v=1783498597","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2915d0157956450c9354969f25b786585c041479.webp?v=1783498598","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10e07dacb42120643535e9487a7343109dbba4b.webp?v=1783498598","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55768d4e4bab39d2239778d22978d14e7687aa12.webp?v=1783498599","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e0ce8b46952b7558e72c51c93b94b1991cf29edb.webp?v=1783498600","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8503f59b7a33e5b4838e2cee49939f055a6ee7fc.webp?v=1783498601"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-185-EA24_1d092c9f-7a69-4331-a54b-5e9d96a7d250.png?v=1690634926","options":["color"],"media":[{"alt":null,"id":22642986451043,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-185-EA24_1d092c9f-7a69-4331-a54b-5e9d96a7d250.png?v=1690634926"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-185-EA24_1d092c9f-7a69-4331-a54b-5e9d96a7d250.png?v=1690634926","width":2000},{"alt":null,"id":27715588063331,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef74cacf815ed5ab8f09ab070ff0cc5fa282e1a.webp?v=1783498594"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef74cacf815ed5ab8f09ab070ff0cc5fa282e1a.webp?v=1783498594","width":2000},{"alt":null,"id":27715588816995,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77e425e58775a9f7dd3a4fcf94037eaecad12f68.webp?v=1783498595"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77e425e58775a9f7dd3a4fcf94037eaecad12f68.webp?v=1783498595","width":2000},{"alt":null,"id":27715589668963,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/091aa8cbfaed8b5adb6b03438a2c0ecde4297542.webp?v=1783498595"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/091aa8cbfaed8b5adb6b03438a2c0ecde4297542.webp?v=1783498595","width":2000},{"alt":null,"id":27715590127715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/16258fc17f594817a90029b8175222c208facdb7.webp?v=1783498596"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/16258fc17f594817a90029b8175222c208facdb7.webp?v=1783498596","width":2000},{"alt":null,"id":27715591012451,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b175a4cfc6aa14a728a5d8e9094daef674c32e0.webp?v=1783498597"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b175a4cfc6aa14a728a5d8e9094daef674c32e0.webp?v=1783498597","width":2000},{"alt":null,"id":27715591503971,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2915d0157956450c9354969f25b786585c041479.webp?v=1783498598"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2915d0157956450c9354969f25b786585c041479.webp?v=1783498598","width":2000},{"alt":null,"id":27715592519779,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10e07dacb42120643535e9487a7343109dbba4b.webp?v=1783498598"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f10e07dacb42120643535e9487a7343109dbba4b.webp?v=1783498598","width":2000},{"alt":null,"id":27715594027107,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55768d4e4bab39d2239778d22978d14e7687aa12.webp?v=1783498599"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55768d4e4bab39d2239778d22978d14e7687aa12.webp?v=1783498599","width":2000},{"alt":null,"id":27715594453091,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e0ce8b46952b7558e72c51c93b94b1991cf29edb.webp?v=1783498600"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e0ce8b46952b7558e72c51c93b94b1991cf29edb.webp?v=1783498600","width":2000},{"alt":null,"id":27715595141219,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8503f59b7a33e5b4838e2cee49939f055a6ee7fc.webp?v=1783498601"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8503f59b7a33e5b4838e2cee49939f055a6ee7fc.webp?v=1783498601","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":40611215540323,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118552-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210796527715,"product_id":6986482384995,"position":7,"created_at":"2026-07-08T16:16:35+08:00","updated_at":"2026-07-08T16:16:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2915d0157956450c9354969f25b786585c041479.webp?v=1783498598","variant_ids":[40611215540323]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - Black","public_title":"Black","options":["Black"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118552-EA24","featured_media":{"alt":null,"id":27715591503971,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2915d0157956450c9354969f25b786585c041479.webp?v=1783498598"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40611215573091,"title":"White","option1":"White","option2":null,"option3":null,"sku":"SST0118553-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210793807971,"product_id":6986482384995,"position":3,"created_at":"2026-07-08T16:16:33+08:00","updated_at":"2026-07-08T16:16:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77e425e58775a9f7dd3a4fcf94037eaecad12f68.webp?v=1783498595","variant_ids":[40611215573091]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - White","public_title":"White","options":["White"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118553-EA24","featured_media":{"alt":null,"id":27715588816995,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77e425e58775a9f7dd3a4fcf94037eaecad12f68.webp?v=1783498595"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40611215802467,"title":"Sage Green","option1":"Sage Green","option2":null,"option3":null,"sku":"SST01185P2-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210795577443,"product_id":6986482384995,"position":5,"created_at":"2026-07-08T16:16:34+08:00","updated_at":"2026-07-08T16:16:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/16258fc17f594817a90029b8175222c208facdb7.webp?v=1783498596","variant_ids":[40611215802467]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - Sage Green","public_title":"Sage Green","options":["Sage Green"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01185P2-EA24","featured_media":{"alt":null,"id":27715590127715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/16258fc17f594817a90029b8175222c208facdb7.webp?v=1783498596"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40700825632867,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"SST011850A-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210796003427,"product_id":6986482384995,"position":6,"created_at":"2026-07-08T16:16:35+08:00","updated_at":"2026-07-08T16:16:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b175a4cfc6aa14a728a5d8e9094daef674c32e0.webp?v=1783498597","variant_ids":[40700825632867]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011850A-EA24","featured_media":{"alt":null,"id":27715591012451,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b175a4cfc6aa14a728a5d8e9094daef674c32e0.webp?v=1783498597"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40671596347491,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011850B-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210799050851,"product_id":6986482384995,"position":9,"created_at":"2026-07-08T16:16:37+08:00","updated_at":"2026-07-08T16:16:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55768d4e4bab39d2239778d22978d14e7687aa12.webp?v=1783498599","variant_ids":[40671596347491]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011850B-EA24","featured_media":{"alt":null,"id":27715594027107,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55768d4e4bab39d2239778d22978d14e7687aa12.webp?v=1783498599"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":40611215540323,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118552-EA24","requires_shipping":true,"taxable":true,"featured_image":{"id":36210796527715,"product_id":6986482384995,"position":7,"created_at":"2026-07-08T16:16:35+08:00","updated_at":"2026-07-08T16:16:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2915d0157956450c9354969f25b786585c041479.webp?v=1783498598","variant_ids":[40611215540323]},"available":true,"name":"iPhone 12 \/ 12 Pro SolidSuit 爽爽貓 by SECOND You Make My Heart Smile - Black","public_title":"Black","options":["Black"],"price":125000,"weight":830,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118552-EA24","featured_media":{"alt":null,"id":27715591503971,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2915d0157956450c9354969f25b786585c041479.webp?v=1783498598"}},"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: "停產" }