$product = {"id":7830885433443,"title":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅)","handle":"iphone-12-pro-mod-nx-bumper-original-design-dk01","description":null,"published_at":"2025-07-04T10:15:02+08:00","created_at":"2025-07-03T16:10:38+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer-valentines-day-collection","device-iPhone 12 Pro","discountable-item","merge","original-design","reseller-valentines-day-collection"],"price":90000,"price_min":90000,"price_max":90000,"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":43507377799267,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116527882339,"product_id":7830885433443,"position":8,"created_at":"2025-07-03T16:10:43+08:00","updated_at":"2025-07-03T16:10:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/511f06e0314b04c058d8370e8b1577f254449bde.webp?v=1751530244","variant_ids":[43507377799267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-DK01","featured_media":{"alt":null,"id":25769501884515,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/511f06e0314b04c058d8370e8b1577f254449bde.webp?v=1751530244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43507381600355,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116523032675,"product_id":7830885433443,"position":1,"created_at":"2025-07-03T16:10:39+08:00","updated_at":"2025-07-03T16:10:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/52b7c44e5230e42c01cc8e50881be737f935d54f.webp?v=1751530240","variant_ids":[43507381600355]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-DK01","featured_media":{"alt":null,"id":25769499590755,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/52b7c44e5230e42c01cc8e50881be737f935d54f.webp?v=1751530240"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43507381665891,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116527390819,"product_id":7830885433443,"position":7,"created_at":"2025-07-03T16:10:42+08:00","updated_at":"2025-07-03T16:10:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d283165b972bf25767dc76a462bb3c7448683e75.webp?v=1751530244","variant_ids":[43507381665891]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-DK01","featured_media":{"alt":null,"id":25769501589603,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d283165b972bf25767dc76a462bb3c7448683e75.webp?v=1751530244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43507381764195,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116528832611,"product_id":7830885433443,"position":10,"created_at":"2025-07-03T16:10:44+08:00","updated_at":"2025-07-03T16:10:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d51530f987081f0c589e54166c9d45acb0f7949e.webp?v=1751530246","variant_ids":[43507381764195]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-DK01","featured_media":{"alt":null,"id":25769502703715,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d51530f987081f0c589e54166c9d45acb0f7949e.webp?v=1751530246"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43507381895267,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116525719651,"product_id":7830885433443,"position":5,"created_at":"2025-07-03T16:10:41+08:00","updated_at":"2025-07-03T16:10:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05e81b763338e4d3207a6eac0a5823b15fca296e.webp?v=1751530243","variant_ids":[43507381895267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-DK01","featured_media":{"alt":null,"id":25769500868707,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05e81b763338e4d3207a6eac0a5823b15fca296e.webp?v=1751530243"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/52b7c44e5230e42c01cc8e50881be737f935d54f.webp?v=1751530240","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6459ef84dd0e0d5ee465aa2db4c9a6c0f8c677d7.webp?v=1751530241","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a2c56ebc62afccb4698e9c3b11ff5c3869ff72d.webp?v=1751530241","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78e2d0922c70ba1b65fce3febdf9af7aa842939f.webp?v=1751530242","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05e81b763338e4d3207a6eac0a5823b15fca296e.webp?v=1751530243","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f38c91c9b56aed418ba4f8a0e7665c37fa37c4de.webp?v=1751530243","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d283165b972bf25767dc76a462bb3c7448683e75.webp?v=1751530244","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/511f06e0314b04c058d8370e8b1577f254449bde.webp?v=1751530244","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71ba224bd857ed76375439c71cd19d58020d7cdb.webp?v=1751530245","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d51530f987081f0c589e54166c9d45acb0f7949e.webp?v=1751530246","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c12f61b04cae6cf115815c1a69d1587490d499.webp?v=1751530246"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/52b7c44e5230e42c01cc8e50881be737f935d54f.webp?v=1751530240","options":["color"],"media":[{"alt":null,"id":25769499590755,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/52b7c44e5230e42c01cc8e50881be737f935d54f.webp?v=1751530240"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/52b7c44e5230e42c01cc8e50881be737f935d54f.webp?v=1751530240","width":2000},{"alt":null,"id":25769499918435,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6459ef84dd0e0d5ee465aa2db4c9a6c0f8c677d7.webp?v=1751530241"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6459ef84dd0e0d5ee465aa2db4c9a6c0f8c677d7.webp?v=1751530241","width":2000},{"alt":null,"id":25769500180579,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a2c56ebc62afccb4698e9c3b11ff5c3869ff72d.webp?v=1751530241"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a2c56ebc62afccb4698e9c3b11ff5c3869ff72d.webp?v=1751530241","width":2000},{"alt":null,"id":25769500606563,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78e2d0922c70ba1b65fce3febdf9af7aa842939f.webp?v=1751530242"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78e2d0922c70ba1b65fce3febdf9af7aa842939f.webp?v=1751530242","width":2000},{"alt":null,"id":25769500868707,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05e81b763338e4d3207a6eac0a5823b15fca296e.webp?v=1751530243"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05e81b763338e4d3207a6eac0a5823b15fca296e.webp?v=1751530243","width":2000},{"alt":null,"id":25769501261923,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f38c91c9b56aed418ba4f8a0e7665c37fa37c4de.webp?v=1751530243"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f38c91c9b56aed418ba4f8a0e7665c37fa37c4de.webp?v=1751530243","width":2000},{"alt":null,"id":25769501589603,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d283165b972bf25767dc76a462bb3c7448683e75.webp?v=1751530244"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d283165b972bf25767dc76a462bb3c7448683e75.webp?v=1751530244","width":2000},{"alt":null,"id":25769501884515,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/511f06e0314b04c058d8370e8b1577f254449bde.webp?v=1751530244"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/511f06e0314b04c058d8370e8b1577f254449bde.webp?v=1751530244","width":2000},{"alt":null,"id":25769502179427,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71ba224bd857ed76375439c71cd19d58020d7cdb.webp?v=1751530245"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71ba224bd857ed76375439c71cd19d58020d7cdb.webp?v=1751530245","width":2000},{"alt":null,"id":25769502703715,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d51530f987081f0c589e54166c9d45acb0f7949e.webp?v=1751530246"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d51530f987081f0c589e54166c9d45acb0f7949e.webp?v=1751530246","width":2000},{"alt":null,"id":25769502933091,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c12f61b04cae6cf115815c1a69d1587490d499.webp?v=1751530246"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c12f61b04cae6cf115815c1a69d1587490d499.webp?v=1751530246","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43507377799267,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116527882339,"product_id":7830885433443,"position":8,"created_at":"2025-07-03T16:10:43+08:00","updated_at":"2025-07-03T16:10:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/511f06e0314b04c058d8370e8b1577f254449bde.webp?v=1751530244","variant_ids":[43507377799267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-DK01","featured_media":{"alt":null,"id":25769501884515,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/511f06e0314b04c058d8370e8b1577f254449bde.webp?v=1751530244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43507381600355,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116523032675,"product_id":7830885433443,"position":1,"created_at":"2025-07-03T16:10:39+08:00","updated_at":"2025-07-03T16:10:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/52b7c44e5230e42c01cc8e50881be737f935d54f.webp?v=1751530240","variant_ids":[43507381600355]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-DK01","featured_media":{"alt":null,"id":25769499590755,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/52b7c44e5230e42c01cc8e50881be737f935d54f.webp?v=1751530240"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43507381665891,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116527390819,"product_id":7830885433443,"position":7,"created_at":"2025-07-03T16:10:42+08:00","updated_at":"2025-07-03T16:10:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d283165b972bf25767dc76a462bb3c7448683e75.webp?v=1751530244","variant_ids":[43507381665891]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-DK01","featured_media":{"alt":null,"id":25769501589603,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d283165b972bf25767dc76a462bb3c7448683e75.webp?v=1751530244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43507381764195,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116528832611,"product_id":7830885433443,"position":10,"created_at":"2025-07-03T16:10:44+08:00","updated_at":"2025-07-03T16:10:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d51530f987081f0c589e54166c9d45acb0f7949e.webp?v=1751530246","variant_ids":[43507381764195]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-DK01","featured_media":{"alt":null,"id":25769502703715,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d51530f987081f0c589e54166c9d45acb0f7949e.webp?v=1751530246"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43507381895267,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116525719651,"product_id":7830885433443,"position":5,"created_at":"2025-07-03T16:10:41+08:00","updated_at":"2025-07-03T16:10:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05e81b763338e4d3207a6eac0a5823b15fca296e.webp?v=1751530243","variant_ids":[43507381895267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-DK01","featured_media":{"alt":null,"id":25769500868707,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05e81b763338e4d3207a6eac0a5823b15fca296e.webp?v=1751530243"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43507377799267,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-DK01","requires_shipping":true,"taxable":true,"featured_image":{"id":34116527882339,"product_id":7830885433443,"position":8,"created_at":"2025-07-03T16:10:43+08:00","updated_at":"2025-07-03T16:10:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/511f06e0314b04c058d8370e8b1577f254449bde.webp?v=1751530244","variant_ids":[43507377799267]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 不只是情人節:愛的方程式 愛的方程式:心形(紅) - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-DK01","featured_media":{"alt":null,"id":25769501884515,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/511f06e0314b04c058d8370e8b1577f254449bde.webp?v=1751530244"}},"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: "停產" }