$product = {"id":7769600032867,"title":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓","handle":"iphone-xr-mod-nx-printable-xf52","description":null,"published_at":"2025-07-16T17:19:25+08:00","created_at":"2025-04-15T18:17:55+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師MOD NX專區-I Love Doodle","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-ilovedoodle","device-iPhone XR","merge","reseller-ilovedoodle"],"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":43303114342499,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0108524-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197055242339,"product_id":7769600032867,"position":7,"created_at":"2025-07-16T14:57:34+08:00","updated_at":"2025-07-16T14:57:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b361f6d5d85160d0e9cae842c45b8cf2ce653664_efde47ce-34e0-4e96-9576-92f7efad7553.webp?v=1752649056","variant_ids":[43303114342499]},"available":true,"name":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108524-XF52","featured_media":{"alt":null,"id":25829690507363,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b361f6d5d85160d0e9cae842c45b8cf2ce653664_efde47ce-34e0-4e96-9576-92f7efad7553.webp?v=1752649056"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303118733411,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0108504-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197056979043,"product_id":7769600032867,"position":10,"created_at":"2025-07-16T14:57:37+08:00","updated_at":"2025-07-16T14:57:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f19ccb3e6ce4bce68cbffbf5e38fbe79c7db56f_350b4dfe-6042-4eb7-bd9e-91959c7424e5.webp?v=1752649058","variant_ids":[43303118733411]},"available":true,"name":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108504-XF52","featured_media":{"alt":null,"id":25829691326563,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f19ccb3e6ce4bce68cbffbf5e38fbe79c7db56f_350b4dfe-6042-4eb7-bd9e-91959c7424e5.webp?v=1752649058"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303118831715,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0108515-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197057273955,"product_id":7769600032867,"position":11,"created_at":"2025-07-16T14:57:37+08:00","updated_at":"2025-07-16T14:57:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aab317f2f8f2142806ee1445059b6cf97d4e42a_5ded3dc5-4ee0-455f-880e-196715884b50.webp?v=1752649059","variant_ids":[43303118831715]},"available":true,"name":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108515-XF52","featured_media":{"alt":null,"id":25829691457635,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aab317f2f8f2142806ee1445059b6cf97d4e42a_5ded3dc5-4ee0-455f-880e-196715884b50.webp?v=1752649059"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303118864483,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01085C1-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197054324835,"product_id":7769600032867,"position":5,"created_at":"2025-07-16T14:57:33+08:00","updated_at":"2025-07-16T14:57:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee48366cafd103dac28973b10abb39b8db6d3469_8b9bb0e8-1972-4126-b66c-9aeade0246d1.webp?v=1752649055","variant_ids":[43303118864483]},"available":true,"name":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01085C1-XF52","featured_media":{"alt":null,"id":25829690081379,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee48366cafd103dac28973b10abb39b8db6d3469_8b9bb0e8-1972-4126-b66c-9aeade0246d1.webp?v=1752649055"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee67acd956d263600e860ffdc5d4069290eaac33.webp?v=1744712282","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e186e0af618fcb2db947f78ed3b27885756cd220_78e87fa9-640f-49a6-894c-e0920b0d64da.webp?v=1752649054","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be000cf61ba9d533ec764d6ab466946e0de2ddfc_43a70fd3-2147-4f3f-a688-3d74ab281bf3.webp?v=1752649054","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/794fadb52d9b746c788ad219aba24f2aaa75ecb0_1b940920-cc4b-4ffc-bd58-27b10dd93891.webp?v=1752649055","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee48366cafd103dac28973b10abb39b8db6d3469_8b9bb0e8-1972-4126-b66c-9aeade0246d1.webp?v=1752649055","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/146e270f0cf56041129d0796cbc4e6a15e5f1d02_d2067d28-ca8d-4a91-a929-e43e3d73d559.webp?v=1752649056","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b361f6d5d85160d0e9cae842c45b8cf2ce653664_efde47ce-34e0-4e96-9576-92f7efad7553.webp?v=1752649056","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ac241f46b9ce1fbb08f27f5d7f49b7ef2d516a_888f9333-9ebc-451a-90a3-fe2a06fb77b0.webp?v=1752649057","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31cd374f336fcb91409755ffcef227bcd03c29bc_38ac78af-268a-4112-89e5-31c214772fb9.webp?v=1752649058","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f19ccb3e6ce4bce68cbffbf5e38fbe79c7db56f_350b4dfe-6042-4eb7-bd9e-91959c7424e5.webp?v=1752649058","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aab317f2f8f2142806ee1445059b6cf97d4e42a_5ded3dc5-4ee0-455f-880e-196715884b50.webp?v=1752649059"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee67acd956d263600e860ffdc5d4069290eaac33.webp?v=1744712282","options":["color"],"media":[{"alt":null,"id":25495918706787,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee67acd956d263600e860ffdc5d4069290eaac33.webp?v=1744712282"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee67acd956d263600e860ffdc5d4069290eaac33.webp?v=1744712282","width":2000},{"alt":null,"id":25829689327715,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e186e0af618fcb2db947f78ed3b27885756cd220_78e87fa9-640f-49a6-894c-e0920b0d64da.webp?v=1752649054"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e186e0af618fcb2db947f78ed3b27885756cd220_78e87fa9-640f-49a6-894c-e0920b0d64da.webp?v=1752649054","width":2000},{"alt":null,"id":25829689589859,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be000cf61ba9d533ec764d6ab466946e0de2ddfc_43a70fd3-2147-4f3f-a688-3d74ab281bf3.webp?v=1752649054"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be000cf61ba9d533ec764d6ab466946e0de2ddfc_43a70fd3-2147-4f3f-a688-3d74ab281bf3.webp?v=1752649054","width":2000},{"alt":null,"id":25829689852003,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/794fadb52d9b746c788ad219aba24f2aaa75ecb0_1b940920-cc4b-4ffc-bd58-27b10dd93891.webp?v=1752649055"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/794fadb52d9b746c788ad219aba24f2aaa75ecb0_1b940920-cc4b-4ffc-bd58-27b10dd93891.webp?v=1752649055","width":2000},{"alt":null,"id":25829690081379,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee48366cafd103dac28973b10abb39b8db6d3469_8b9bb0e8-1972-4126-b66c-9aeade0246d1.webp?v=1752649055"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee48366cafd103dac28973b10abb39b8db6d3469_8b9bb0e8-1972-4126-b66c-9aeade0246d1.webp?v=1752649055","width":2000},{"alt":null,"id":25829690310755,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/146e270f0cf56041129d0796cbc4e6a15e5f1d02_d2067d28-ca8d-4a91-a929-e43e3d73d559.webp?v=1752649056"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/146e270f0cf56041129d0796cbc4e6a15e5f1d02_d2067d28-ca8d-4a91-a929-e43e3d73d559.webp?v=1752649056","width":2000},{"alt":null,"id":25829690507363,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b361f6d5d85160d0e9cae842c45b8cf2ce653664_efde47ce-34e0-4e96-9576-92f7efad7553.webp?v=1752649056"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b361f6d5d85160d0e9cae842c45b8cf2ce653664_efde47ce-34e0-4e96-9576-92f7efad7553.webp?v=1752649056","width":2000},{"alt":null,"id":25829690605667,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ac241f46b9ce1fbb08f27f5d7f49b7ef2d516a_888f9333-9ebc-451a-90a3-fe2a06fb77b0.webp?v=1752649057"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ac241f46b9ce1fbb08f27f5d7f49b7ef2d516a_888f9333-9ebc-451a-90a3-fe2a06fb77b0.webp?v=1752649057","width":2000},{"alt":null,"id":25829691097187,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31cd374f336fcb91409755ffcef227bcd03c29bc_38ac78af-268a-4112-89e5-31c214772fb9.webp?v=1752649058"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31cd374f336fcb91409755ffcef227bcd03c29bc_38ac78af-268a-4112-89e5-31c214772fb9.webp?v=1752649058","width":2000},{"alt":null,"id":25829691326563,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f19ccb3e6ce4bce68cbffbf5e38fbe79c7db56f_350b4dfe-6042-4eb7-bd9e-91959c7424e5.webp?v=1752649058"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f19ccb3e6ce4bce68cbffbf5e38fbe79c7db56f_350b4dfe-6042-4eb7-bd9e-91959c7424e5.webp?v=1752649058","width":2000},{"alt":null,"id":25829691457635,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aab317f2f8f2142806ee1445059b6cf97d4e42a_5ded3dc5-4ee0-455f-880e-196715884b50.webp?v=1752649059"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aab317f2f8f2142806ee1445059b6cf97d4e42a_5ded3dc5-4ee0-455f-880e-196715884b50.webp?v=1752649059","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43303114342499,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0108524-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197055242339,"product_id":7769600032867,"position":7,"created_at":"2025-07-16T14:57:34+08:00","updated_at":"2025-07-16T14:57:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b361f6d5d85160d0e9cae842c45b8cf2ce653664_efde47ce-34e0-4e96-9576-92f7efad7553.webp?v=1752649056","variant_ids":[43303114342499]},"available":true,"name":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108524-XF52","featured_media":{"alt":null,"id":25829690507363,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b361f6d5d85160d0e9cae842c45b8cf2ce653664_efde47ce-34e0-4e96-9576-92f7efad7553.webp?v=1752649056"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303118733411,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0108504-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197056979043,"product_id":7769600032867,"position":10,"created_at":"2025-07-16T14:57:37+08:00","updated_at":"2025-07-16T14:57:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f19ccb3e6ce4bce68cbffbf5e38fbe79c7db56f_350b4dfe-6042-4eb7-bd9e-91959c7424e5.webp?v=1752649058","variant_ids":[43303118733411]},"available":true,"name":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108504-XF52","featured_media":{"alt":null,"id":25829691326563,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f19ccb3e6ce4bce68cbffbf5e38fbe79c7db56f_350b4dfe-6042-4eb7-bd9e-91959c7424e5.webp?v=1752649058"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303118831715,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0108515-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197057273955,"product_id":7769600032867,"position":11,"created_at":"2025-07-16T14:57:37+08:00","updated_at":"2025-07-16T14:57:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aab317f2f8f2142806ee1445059b6cf97d4e42a_5ded3dc5-4ee0-455f-880e-196715884b50.webp?v=1752649059","variant_ids":[43303118831715]},"available":true,"name":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108515-XF52","featured_media":{"alt":null,"id":25829691457635,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aab317f2f8f2142806ee1445059b6cf97d4e42a_5ded3dc5-4ee0-455f-880e-196715884b50.webp?v=1752649059"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43303118864483,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01085C1-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197054324835,"product_id":7769600032867,"position":5,"created_at":"2025-07-16T14:57:33+08:00","updated_at":"2025-07-16T14:57:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee48366cafd103dac28973b10abb39b8db6d3469_8b9bb0e8-1972-4126-b66c-9aeade0246d1.webp?v=1752649055","variant_ids":[43303118864483]},"available":true,"name":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01085C1-XF52","featured_media":{"alt":null,"id":25829690081379,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee48366cafd103dac28973b10abb39b8db6d3469_8b9bb0e8-1972-4126-b66c-9aeade0246d1.webp?v=1752649055"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43303114342499,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0108524-XF52","requires_shipping":true,"taxable":true,"featured_image":{"id":34197055242339,"product_id":7769600032867,"position":7,"created_at":"2025-07-16T14:57:34+08:00","updated_at":"2025-07-16T14:57:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b361f6d5d85160d0e9cae842c45b8cf2ce653664_efde47ce-34e0-4e96-9576-92f7efad7553.webp?v=1752649056","variant_ids":[43303114342499]},"available":true,"name":"iPhone XR Mod NX ilovedoodle The Sun and Cat - 太陽與貓 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108524-XF52","featured_media":{"alt":null,"id":25829690507363,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b361f6d5d85160d0e9cae842c45b8cf2ce653664_efde47ce-34e0-4e96-9576-92f7efad7553.webp?v=1752649056"}},"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: "停產"
}