$product = {"id":7876118184035,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生","handle":"iphone-12-pro-mod-nx-magsafe-printable-ea109","description":null,"published_at":"2025-09-04T09:40:43+08:00","created_at":"2025-09-03T12:05:44+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":110000,"price_min":110000,"price_max":110000,"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":43675476525155,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416442605667,"product_id":7876118184035,"position":6,"created_at":"2025-09-03T12:05:52+08:00","updated_at":"2025-09-03T12:05:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68bd908cb56a15483b247480f328bd4f3d7c5637.webp?v=1756872354","variant_ids":[43675476525155]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-EA109","featured_media":{"alt":null,"id":25988717084771,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68bd908cb56a15483b247480f328bd4f3d7c5637.webp?v=1756872354"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43675479048291,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416440803427,"product_id":7876118184035,"position":1,"created_at":"2025-09-03T12:05:48+08:00","updated_at":"2025-09-03T12:05:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56a4f4f9b29e29c9eb6619367d01f3332416584f.webp?v=1756872350","variant_ids":[43675479048291]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-EA109","featured_media":{"alt":null,"id":25988715282531,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56a4f4f9b29e29c9eb6619367d01f3332416584f.webp?v=1756872350"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43675479113827,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416440967267,"product_id":7876118184035,"position":2,"created_at":"2025-09-03T12:05:49+08:00","updated_at":"2025-09-03T12:05:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eca69d1727fe8f39bbc9bddd0009bcf73c913f25.webp?v=1756872351","variant_ids":[43675479113827]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-EA109","featured_media":{"alt":null,"id":25988715446371,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eca69d1727fe8f39bbc9bddd0009bcf73c913f25.webp?v=1756872351"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43675479212131,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416444014691,"product_id":7876118184035,"position":11,"created_at":"2025-09-03T12:05:56+08:00","updated_at":"2025-09-03T12:05:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c9181641edf1056acf3b98a91859389a232404.webp?v=1756872358","variant_ids":[43675479212131]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185J5-EA109","featured_media":{"alt":null,"id":25988718493795,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c9181641edf1056acf3b98a91859389a232404.webp?v=1756872358"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43675479310435,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416443392099,"product_id":7876118184035,"position":9,"created_at":"2025-09-03T12:05:55+08:00","updated_at":"2025-09-03T12:05:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad3074297c42c24e23afa4b47a8660ac33f83076.webp?v=1756872357","variant_ids":[43675479310435]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-EA109","featured_media":{"alt":null,"id":25988717871203,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad3074297c42c24e23afa4b47a8660ac33f83076.webp?v=1756872357"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56a4f4f9b29e29c9eb6619367d01f3332416584f.webp?v=1756872350","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eca69d1727fe8f39bbc9bddd0009bcf73c913f25.webp?v=1756872351","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b9b15349144bc3f4effe9c7a1f6a8359fa9461f.webp?v=1756872352","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0cd2046d7cceebb5422b3d7c44c846b4f63bdce.webp?v=1756872353","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1fd11fd099a8a4327ce3914ea4b40017787e9325.webp?v=1756872354","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68bd908cb56a15483b247480f328bd4f3d7c5637.webp?v=1756872354","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d07dfef81deb710dec9f447f3ba4590b37c49a8a.webp?v=1756872355","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0befd303904d5df583ea05075f29ac616b828a02.webp?v=1756872356","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad3074297c42c24e23afa4b47a8660ac33f83076.webp?v=1756872357","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f18755187f1295dbf80b405c35df74fd0f795402.webp?v=1756872357","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c9181641edf1056acf3b98a91859389a232404.webp?v=1756872358"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56a4f4f9b29e29c9eb6619367d01f3332416584f.webp?v=1756872350","options":["color"],"media":[{"alt":null,"id":25988715282531,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56a4f4f9b29e29c9eb6619367d01f3332416584f.webp?v=1756872350"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56a4f4f9b29e29c9eb6619367d01f3332416584f.webp?v=1756872350","width":2000},{"alt":null,"id":25988715446371,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eca69d1727fe8f39bbc9bddd0009bcf73c913f25.webp?v=1756872351"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eca69d1727fe8f39bbc9bddd0009bcf73c913f25.webp?v=1756872351","width":2000},{"alt":null,"id":25988715905123,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b9b15349144bc3f4effe9c7a1f6a8359fa9461f.webp?v=1756872352"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b9b15349144bc3f4effe9c7a1f6a8359fa9461f.webp?v=1756872352","width":2000},{"alt":null,"id":25988716396643,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0cd2046d7cceebb5422b3d7c44c846b4f63bdce.webp?v=1756872353"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b0cd2046d7cceebb5422b3d7c44c846b4f63bdce.webp?v=1756872353","width":2000},{"alt":null,"id":25988716822627,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1fd11fd099a8a4327ce3914ea4b40017787e9325.webp?v=1756872354"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1fd11fd099a8a4327ce3914ea4b40017787e9325.webp?v=1756872354","width":2000},{"alt":null,"id":25988717084771,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68bd908cb56a15483b247480f328bd4f3d7c5637.webp?v=1756872354"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68bd908cb56a15483b247480f328bd4f3d7c5637.webp?v=1756872354","width":2000},{"alt":null,"id":25988717379683,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d07dfef81deb710dec9f447f3ba4590b37c49a8a.webp?v=1756872355"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d07dfef81deb710dec9f447f3ba4590b37c49a8a.webp?v=1756872355","width":2000},{"alt":null,"id":25988717609059,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0befd303904d5df583ea05075f29ac616b828a02.webp?v=1756872356"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0befd303904d5df583ea05075f29ac616b828a02.webp?v=1756872356","width":2000},{"alt":null,"id":25988717871203,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad3074297c42c24e23afa4b47a8660ac33f83076.webp?v=1756872357"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad3074297c42c24e23afa4b47a8660ac33f83076.webp?v=1756872357","width":2000},{"alt":null,"id":25988718133347,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f18755187f1295dbf80b405c35df74fd0f795402.webp?v=1756872357"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f18755187f1295dbf80b405c35df74fd0f795402.webp?v=1756872357","width":2000},{"alt":null,"id":25988718493795,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c9181641edf1056acf3b98a91859389a232404.webp?v=1756872358"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c9181641edf1056acf3b98a91859389a232404.webp?v=1756872358","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43675476525155,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416442605667,"product_id":7876118184035,"position":6,"created_at":"2025-09-03T12:05:52+08:00","updated_at":"2025-09-03T12:05:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68bd908cb56a15483b247480f328bd4f3d7c5637.webp?v=1756872354","variant_ids":[43675476525155]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-EA109","featured_media":{"alt":null,"id":25988717084771,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68bd908cb56a15483b247480f328bd4f3d7c5637.webp?v=1756872354"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43675479048291,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416440803427,"product_id":7876118184035,"position":1,"created_at":"2025-09-03T12:05:48+08:00","updated_at":"2025-09-03T12:05:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56a4f4f9b29e29c9eb6619367d01f3332416584f.webp?v=1756872350","variant_ids":[43675479048291]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-EA109","featured_media":{"alt":null,"id":25988715282531,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/56a4f4f9b29e29c9eb6619367d01f3332416584f.webp?v=1756872350"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43675479113827,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416440967267,"product_id":7876118184035,"position":2,"created_at":"2025-09-03T12:05:49+08:00","updated_at":"2025-09-03T12:05:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eca69d1727fe8f39bbc9bddd0009bcf73c913f25.webp?v=1756872351","variant_ids":[43675479113827]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-EA109","featured_media":{"alt":null,"id":25988715446371,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eca69d1727fe8f39bbc9bddd0009bcf73c913f25.webp?v=1756872351"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43675479212131,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416444014691,"product_id":7876118184035,"position":11,"created_at":"2025-09-03T12:05:56+08:00","updated_at":"2025-09-03T12:05:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c9181641edf1056acf3b98a91859389a232404.webp?v=1756872358","variant_ids":[43675479212131]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185J5-EA109","featured_media":{"alt":null,"id":25988718493795,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9c9181641edf1056acf3b98a91859389a232404.webp?v=1756872358"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43675479310435,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416443392099,"product_id":7876118184035,"position":9,"created_at":"2025-09-03T12:05:55+08:00","updated_at":"2025-09-03T12:05:57+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad3074297c42c24e23afa4b47a8660ac33f83076.webp?v=1756872357","variant_ids":[43675479310435]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-EA109","featured_media":{"alt":null,"id":25988717871203,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad3074297c42c24e23afa4b47a8660ac33f83076.webp?v=1756872357"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43675476525155,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-EA109","requires_shipping":true,"taxable":true,"featured_image":{"id":34416442605667,"product_id":7876118184035,"position":6,"created_at":"2025-09-03T12:05:52+08:00","updated_at":"2025-09-03T12:05:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68bd908cb56a15483b247480f328bd4f3d7c5637.webp?v=1756872354","variant_ids":[43675476525155]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 爽爽貓 by SECOND 好運發生 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-EA109","featured_media":{"alt":null,"id":25988717084771,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/68bd908cb56a15483b247480f328bd4f3d7c5637.webp?v=1756872354"}},"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: "停產" }