$product = {"id":7944291975267,"title":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間","handle":"iphone-13-mini-solidsuit-classic-yoh07","description":null,"published_at":"2025-12-24T10:20:37+08:00","created_at":"2025-12-23T16:50:20+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-yohand","device-iPhone 13 Mini","merge","reseller-yohand"],"price":83000,"price_min":83000,"price_max":83000,"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":43907941302371,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"SST01228Z9-YOH07","requires_shipping":true,"taxable":true,"featured_image":{"id":36271459041379,"product_id":7944291975267,"position":9,"created_at":"2026-07-15T14:27:10+08:00","updated_at":"2026-07-15T14:27:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8_88968f2c-a868-4c65-ba43-f8d174c9a763.webp?v=1784096832","variant_ids":[43907941302371]},"available":true,"name":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間 - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z9-YOH07","featured_media":{"alt":null,"id":27775514771555,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8_88968f2c-a868-4c65-ba43-f8d174c9a763.webp?v=1784096832"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907941826659,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"SST01228Z8-YOH07","requires_shipping":true,"taxable":true,"featured_image":{"id":36271459434595,"product_id":7944291975267,"position":11,"created_at":"2026-07-15T14:27:11+08:00","updated_at":"2026-07-15T14:27:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482_5b3e4f46-7c28-47dd-974c-451eebc74b94.webp?v=1784096833","variant_ids":[43907941826659]},"available":true,"name":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z8-YOH07","featured_media":{"alt":null,"id":27775515164771,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482_5b3e4f46-7c28-47dd-974c-451eebc74b94.webp?v=1784096833"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907942350947,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0122852-YOH07","requires_shipping":true,"taxable":true,"featured_image":{"id":36271459237987,"product_id":7944291975267,"position":10,"created_at":"2026-07-15T14:27:10+08:00","updated_at":"2026-07-15T14:27:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e_4b02afb5-46da-4794-8ef8-00b4aaa0b949.webp?v=1784096832","variant_ids":[43907942350947]},"available":true,"name":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間 - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0122852-YOH07","featured_media":{"alt":null,"id":27775514968163,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e_4b02afb5-46da-4794-8ef8-00b4aaa0b949.webp?v=1784096832"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907942678627,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01228O8-YOH07","requires_shipping":true,"taxable":true,"featured_image":{"id":36271459532899,"product_id":7944291975267,"position":12,"created_at":"2026-07-15T14:27:12+08:00","updated_at":"2026-07-15T14:27:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4_777db07e-83b6-4498-972d-21adaeaea967.webp?v=1784096834","variant_ids":[43907942678627]},"available":true,"name":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228O8-YOH07","featured_media":{"alt":null,"id":27775515263075,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4_777db07e-83b6-4498-972d-21adaeaea967.webp?v=1784096834"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d2d7d6d286bec5a5554b8ad92e25bc2fc7ea844.webp?v=1766479850","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e.webp?v=1766479851","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8.webp?v=1766479851","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4.webp?v=1766479852","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a1f32808df54e2de7f2e6bc5165ce05b38d716b.webp?v=1766479852","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62a9e8184154e2d8f4d6145c8863668545231b30.webp?v=1766479853","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482.webp?v=1766479854","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33414a07beb4b1b5cf47e3f21c557b1a313991f2.webp?v=1766479855","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8_88968f2c-a868-4c65-ba43-f8d174c9a763.webp?v=1784096832","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e_4b02afb5-46da-4794-8ef8-00b4aaa0b949.webp?v=1784096832","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482_5b3e4f46-7c28-47dd-974c-451eebc74b94.webp?v=1784096833","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4_777db07e-83b6-4498-972d-21adaeaea967.webp?v=1784096834"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d2d7d6d286bec5a5554b8ad92e25bc2fc7ea844.webp?v=1766479850","options":["color"],"media":[{"alt":null,"id":26563196387427,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d2d7d6d286bec5a5554b8ad92e25bc2fc7ea844.webp?v=1766479850"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d2d7d6d286bec5a5554b8ad92e25bc2fc7ea844.webp?v=1766479850","width":2000},{"alt":null,"id":26563196780643,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e.webp?v=1766479851"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e.webp?v=1766479851","width":2000},{"alt":null,"id":26563197272163,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8.webp?v=1766479851"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8.webp?v=1766479851","width":2000},{"alt":null,"id":26563197665379,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4.webp?v=1766479852"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4.webp?v=1766479852","width":2000},{"alt":null,"id":26563198124131,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a1f32808df54e2de7f2e6bc5165ce05b38d716b.webp?v=1766479852"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2a1f32808df54e2de7f2e6bc5165ce05b38d716b.webp?v=1766479852","width":2000},{"alt":null,"id":26563198451811,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62a9e8184154e2d8f4d6145c8863668545231b30.webp?v=1766479853"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62a9e8184154e2d8f4d6145c8863668545231b30.webp?v=1766479853","width":2000},{"alt":null,"id":26563198681187,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482.webp?v=1766479854"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482.webp?v=1766479854","width":2000},{"alt":null,"id":26563198910563,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33414a07beb4b1b5cf47e3f21c557b1a313991f2.webp?v=1766479855"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33414a07beb4b1b5cf47e3f21c557b1a313991f2.webp?v=1766479855","width":2000},{"alt":null,"id":27775514771555,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8_88968f2c-a868-4c65-ba43-f8d174c9a763.webp?v=1784096832"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8_88968f2c-a868-4c65-ba43-f8d174c9a763.webp?v=1784096832","width":2000},{"alt":null,"id":27775514968163,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e_4b02afb5-46da-4794-8ef8-00b4aaa0b949.webp?v=1784096832"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e_4b02afb5-46da-4794-8ef8-00b4aaa0b949.webp?v=1784096832","width":2000},{"alt":null,"id":27775515164771,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482_5b3e4f46-7c28-47dd-974c-451eebc74b94.webp?v=1784096833"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482_5b3e4f46-7c28-47dd-974c-451eebc74b94.webp?v=1784096833","width":2000},{"alt":null,"id":27775515263075,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4_777db07e-83b6-4498-972d-21adaeaea967.webp?v=1784096834"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4_777db07e-83b6-4498-972d-21adaeaea967.webp?v=1784096834","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43907941302371,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"SST01228Z9-YOH07","requires_shipping":true,"taxable":true,"featured_image":{"id":36271459041379,"product_id":7944291975267,"position":9,"created_at":"2026-07-15T14:27:10+08:00","updated_at":"2026-07-15T14:27:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8_88968f2c-a868-4c65-ba43-f8d174c9a763.webp?v=1784096832","variant_ids":[43907941302371]},"available":true,"name":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間 - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z9-YOH07","featured_media":{"alt":null,"id":27775514771555,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8_88968f2c-a868-4c65-ba43-f8d174c9a763.webp?v=1784096832"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907941826659,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"SST01228Z8-YOH07","requires_shipping":true,"taxable":true,"featured_image":{"id":36271459434595,"product_id":7944291975267,"position":11,"created_at":"2026-07-15T14:27:11+08:00","updated_at":"2026-07-15T14:27:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482_5b3e4f46-7c28-47dd-974c-451eebc74b94.webp?v=1784096833","variant_ids":[43907941826659]},"available":true,"name":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z8-YOH07","featured_media":{"alt":null,"id":27775515164771,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d7d082776607377db9714bb2aba6dc60899db482_5b3e4f46-7c28-47dd-974c-451eebc74b94.webp?v=1784096833"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907942350947,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0122852-YOH07","requires_shipping":true,"taxable":true,"featured_image":{"id":36271459237987,"product_id":7944291975267,"position":10,"created_at":"2026-07-15T14:27:10+08:00","updated_at":"2026-07-15T14:27:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e_4b02afb5-46da-4794-8ef8-00b4aaa0b949.webp?v=1784096832","variant_ids":[43907942350947]},"available":true,"name":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間 - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0122852-YOH07","featured_media":{"alt":null,"id":27775514968163,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/13fab00b008172a3c04d06df237060d3eb67165e_4b02afb5-46da-4794-8ef8-00b4aaa0b949.webp?v=1784096832"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43907942678627,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"SST01228O8-YOH07","requires_shipping":true,"taxable":true,"featured_image":{"id":36271459532899,"product_id":7944291975267,"position":12,"created_at":"2026-07-15T14:27:12+08:00","updated_at":"2026-07-15T14:27:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4_777db07e-83b6-4498-972d-21adaeaea967.webp?v=1784096834","variant_ids":[43907942678627]},"available":true,"name":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228O8-YOH07","featured_media":{"alt":null,"id":27775515263075,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/35fff55d8877c5f1abb05b6c515f6f589e6112e4_777db07e-83b6-4498-972d-21adaeaea967.webp?v=1784096834"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43907941302371,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"SST01228Z9-YOH07","requires_shipping":true,"taxable":true,"featured_image":{"id":36271459041379,"product_id":7944291975267,"position":9,"created_at":"2026-07-15T14:27:10+08:00","updated_at":"2026-07-15T14:27:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8_88968f2c-a868-4c65-ba43-f8d174c9a763.webp?v=1784096832","variant_ids":[43907941302371]},"available":true,"name":"iPhone 13 mini SolidSuit 右手超人 柔軟的時間 - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01228Z9-YOH07","featured_media":{"alt":null,"id":27775514771555,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c567ab4592532320c79a3ee12940a5380883e8e8_88968f2c-a868-4c65-ba43-f8d174c9a763.webp?v=1784096832"}},"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: "停產" }