$product = {"id":7920467214435,"title":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-五條悟","handle":"iphone-15-plus-solidx-ptt12","description":null,"published_at":"2025-11-10T16:42:51+08:00","created_at":"2025-11-10T14:51:24+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":43828686782563,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36125154213987,"product_id":7920467214435,"position":17,"created_at":"2026-06-29T15:42:49+08:00","updated_at":"2026-06-29T15:42:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_fc563b81-378c-41e5-954e-7132e89d0ee5.webp?v=1782718972","variant_ids":[43828686782563]},"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-PTT12","featured_media":{"alt":null,"id":27630396964963,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_fc563b81-378c-41e5-954e-7132e89d0ee5.webp?v=1782718972"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828690944099,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36125154377827,"product_id":7920467214435,"position":18,"created_at":"2026-06-29T15:42:50+08:00","updated_at":"2026-06-29T15:42:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_b3d8b363-3d48-428b-b586-eee2e1f45df5.webp?v=1782718972","variant_ids":[43828690944099]},"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-PTT12","featured_media":{"alt":null,"id":27630397128803,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_b3d8b363-3d48-428b-b586-eee2e1f45df5.webp?v=1782718972"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4e2e7dbfd92161015ba3354c6c54aed9b33a152.webp?v=1762757493","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d7bf3cccb0316e4e26d3d1cf38522e66b0c1962.webp?v=1762757493","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/359041b9d1e910289eadf1e45c1a55ce1b5f3b83.webp?v=1762757493","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458.webp?v=1762757494","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5.webp?v=1762757495","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80d44cd5d62b6b96ec9cfea0efa048f7a3a8cb98.webp?v=1762757497","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550.webp?v=1762757498","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/162dc6c794827fdf2729a4b369fd13b082b9654a.webp?v=1762757498","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd80f496773182f9333d20a7b23f644fe73dbcf3.webp?v=1762757499","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8ff87650367da7c8f129e5e017b9246bbe3b69b.webp?v=1762757500","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_5d00fc26-0616-47fd-b967-56e0471a1d64.webp?v=1782266139","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_221f41e5-b395-446d-8cf3-34038099e371.webp?v=1782266140","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5_35d52294-7456-4eaa-94e9-0def1e052fd2.webp?v=1782266141","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_0c7c4e78-786c-46f2-bac5-c5b1f0956428.webp?v=1782291743","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_6d17b58a-afa0-40c8-b575-c14d981691b1.webp?v=1782291744","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5_5014fbd2-ca54-4cbb-a666-bd013aebf071.webp?v=1782291746","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_fc563b81-378c-41e5-954e-7132e89d0ee5.webp?v=1782718972","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_b3d8b363-3d48-428b-b586-eee2e1f45df5.webp?v=1782718972","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5_ed0fd26a-cdab-45f0-8f67-58c55548b3f8.webp?v=1782718973"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4e2e7dbfd92161015ba3354c6c54aed9b33a152.webp?v=1762757493","options":["color"],"media":[{"alt":null,"id":26347616436323,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4e2e7dbfd92161015ba3354c6c54aed9b33a152.webp?v=1762757493"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4e2e7dbfd92161015ba3354c6c54aed9b33a152.webp?v=1762757493","width":2000},{"alt":null,"id":26347616698467,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d7bf3cccb0316e4e26d3d1cf38522e66b0c1962.webp?v=1762757493"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7d7bf3cccb0316e4e26d3d1cf38522e66b0c1962.webp?v=1762757493","width":2000},{"alt":null,"id":26347616895075,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/359041b9d1e910289eadf1e45c1a55ce1b5f3b83.webp?v=1762757493"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/359041b9d1e910289eadf1e45c1a55ce1b5f3b83.webp?v=1762757493","width":2000},{"alt":null,"id":26347617124451,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458.webp?v=1762757494"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458.webp?v=1762757494","width":2000},{"alt":null,"id":26347617353827,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5.webp?v=1762757495"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5.webp?v=1762757495","width":2000},{"alt":null,"id":26347617484899,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80d44cd5d62b6b96ec9cfea0efa048f7a3a8cb98.webp?v=1762757497"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80d44cd5d62b6b96ec9cfea0efa048f7a3a8cb98.webp?v=1762757497","width":2000},{"alt":null,"id":26347617747043,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550.webp?v=1762757498"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550.webp?v=1762757498","width":2000},{"alt":null,"id":26347617845347,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/162dc6c794827fdf2729a4b369fd13b082b9654a.webp?v=1762757498"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/162dc6c794827fdf2729a4b369fd13b082b9654a.webp?v=1762757498","width":2000},{"alt":null,"id":26347617943651,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd80f496773182f9333d20a7b23f644fe73dbcf3.webp?v=1762757499"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bd80f496773182f9333d20a7b23f644fe73dbcf3.webp?v=1762757499","width":2000},{"alt":null,"id":26347618009187,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8ff87650367da7c8f129e5e017b9246bbe3b69b.webp?v=1762757500"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8ff87650367da7c8f129e5e017b9246bbe3b69b.webp?v=1762757500","width":2000},{"alt":null,"id":27587409772643,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_5d00fc26-0616-47fd-b967-56e0471a1d64.webp?v=1782266139"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_5d00fc26-0616-47fd-b967-56e0471a1d64.webp?v=1782266139","width":2000},{"alt":null,"id":27587410591843,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_221f41e5-b395-446d-8cf3-34038099e371.webp?v=1782266140"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_221f41e5-b395-446d-8cf3-34038099e371.webp?v=1782266140","width":2000},{"alt":null,"id":27587410985059,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5_35d52294-7456-4eaa-94e9-0def1e052fd2.webp?v=1782266141"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5_35d52294-7456-4eaa-94e9-0def1e052fd2.webp?v=1782266141","width":2000},{"alt":null,"id":27594719985763,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_0c7c4e78-786c-46f2-bac5-c5b1f0956428.webp?v=1782291743"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_0c7c4e78-786c-46f2-bac5-c5b1f0956428.webp?v=1782291743","width":2000},{"alt":null,"id":27594720608355,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_6d17b58a-afa0-40c8-b575-c14d981691b1.webp?v=1782291744"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_6d17b58a-afa0-40c8-b575-c14d981691b1.webp?v=1782291744","width":2000},{"alt":null,"id":27594721132643,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5_5014fbd2-ca54-4cbb-a666-bd013aebf071.webp?v=1782291746"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5_5014fbd2-ca54-4cbb-a666-bd013aebf071.webp?v=1782291746","width":2000},{"alt":null,"id":27630396964963,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_fc563b81-378c-41e5-954e-7132e89d0ee5.webp?v=1782718972"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_fc563b81-378c-41e5-954e-7132e89d0ee5.webp?v=1782718972","width":2000},{"alt":null,"id":27630397128803,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_b3d8b363-3d48-428b-b586-eee2e1f45df5.webp?v=1782718972"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_b3d8b363-3d48-428b-b586-eee2e1f45df5.webp?v=1782718972","width":2000},{"alt":null,"id":27630397489251,"position":19,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5_ed0fd26a-cdab-45f0-8f67-58c55548b3f8.webp?v=1782718973"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5a5d4aff7366b895374a4a98fabc82f34e35c8b5_ed0fd26a-cdab-45f0-8f67-58c55548b3f8.webp?v=1782718973","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43828686782563,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36125154213987,"product_id":7920467214435,"position":17,"created_at":"2026-06-29T15:42:49+08:00","updated_at":"2026-06-29T15:42:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_fc563b81-378c-41e5-954e-7132e89d0ee5.webp?v=1782718972","variant_ids":[43828686782563]},"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-PTT12","featured_media":{"alt":null,"id":27630396964963,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_fc563b81-378c-41e5-954e-7132e89d0ee5.webp?v=1782718972"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43828690944099,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36125154377827,"product_id":7920467214435,"position":18,"created_at":"2026-06-29T15:42:50+08:00","updated_at":"2026-06-29T15:42:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_b3d8b363-3d48-428b-b586-eee2e1f45df5.webp?v=1782718972","variant_ids":[43828690944099]},"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-PTT12","featured_media":{"alt":null,"id":27630397128803,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc74ea74d784706fe9467b03a66d3cd64397550_b3d8b363-3d48-428b-b586-eee2e1f45df5.webp?v=1782718972"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43828686782563,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT12","requires_shipping":true,"taxable":true,"featured_image":{"id":36125154213987,"product_id":7920467214435,"position":17,"created_at":"2026-06-29T15:42:49+08:00","updated_at":"2026-06-29T15:42:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_fc563b81-378c-41e5-954e-7132e89d0ee5.webp?v=1782718972","variant_ids":[43828686782563]},"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-PTT12","featured_media":{"alt":null,"id":27630396964963,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/083d01722bcfc7345736c4915c7bd05d1f018458_fc563b81-378c-41e5-954e-7132e89d0ee5.webp?v=1782718972"}},"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: "停產" }