$product = {"id":7769417646179,"title":"iPhone 14 Pro Mod NX ilovedoodle White Cat Flowers - 白貓花朵","handle":"iphone-14-pro-mod-nx-printable-xf49","description":null,"published_at":"2025-07-16T17:38:45+08:00","created_at":"2025-04-15T15:46:36+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 14 Pro","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":43302237700195,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF49","requires_shipping":true,"taxable":true,"featured_image":{"id":34196679852131,"product_id":7769417646179,"position":8,"created_at":"2025-07-16T14:48:52+08:00","updated_at":"2025-07-16T14:48:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d910ddf22fac45f8de1611f3b790186f4a999c_597fb692-2e2a-4b8d-acd9-54052a19a62e.webp?v=1752648534","variant_ids":[43302237700195]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle White Cat Flowers - 白貓花朵 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-XF49","featured_media":{"alt":null,"id":25829486329955,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d910ddf22fac45f8de1611f3b790186f4a999c_597fb692-2e2a-4b8d-acd9-54052a19a62e.webp?v=1752648534"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302243172451,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF49","requires_shipping":true,"taxable":true,"featured_image":{"id":34196680409187,"product_id":7769417646179,"position":9,"created_at":"2025-07-16T14:48:53+08:00","updated_at":"2025-07-16T14:48:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb59d24bc598ab72ade8ccad8599d3850d7397e_15b2b7a7-bcdc-4cb8-a578-dc044bae52f8.webp?v=1752648535","variant_ids":[43302243172451]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle White Cat Flowers - 白貓花朵 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126204-XF49","featured_media":{"alt":null,"id":25829486493795,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb59d24bc598ab72ade8ccad8599d3850d7397e_15b2b7a7-bcdc-4cb8-a578-dc044bae52f8.webp?v=1752648535"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302243336291,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF49","requires_shipping":true,"taxable":true,"featured_image":{"id":34196681326691,"product_id":7769417646179,"position":12,"created_at":"2025-07-16T14:48:54+08:00","updated_at":"2025-07-16T14:48:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff76fe5062d1a39827bb0167b4e0d48b2eda4be3_ff460f8d-d70f-40ab-9480-97bfb6a43cee.webp?v=1752648536","variant_ids":[43302243336291]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle White Cat Flowers - 白貓花朵 - 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":"NPB01262J5-XF49","featured_media":{"alt":null,"id":25829487083619,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff76fe5062d1a39827bb0167b4e0d48b2eda4be3_ff460f8d-d70f-40ab-9480-97bfb6a43cee.webp?v=1752648536"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/edef41b54f80e131dc7e51a78003e6440c195f86.webp?v=1744703203","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53d59572ccb1beadc5be28f8b1fe61e6f09db9a0_7321c2ee-bb4d-4fc0-8d8e-d3dd13cc3d9a.webp?v=1752648530","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7e6034f77d1e13fdfa9583fe5d420312a3d67af_0fc46221-8bb4-4e8b-b71c-88fcb56ea0fa.webp?v=1752648531","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/689a3f31beb7509b16c09f630539ac25b2c8c6ce_bd29571a-d9ca-49e4-b3c4-1f03691dc1e0.webp?v=1752648532","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4009f404e3cc06d2cfee8ea3f8c462a71ed74cc_6dafabcf-e735-4e7e-b239-21d8a9348ca6.webp?v=1752648533","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/286d9b86b673859ab4551b8f179d466681060e4b_ec8fa658-e038-4e62-8fd7-a2513f0da54a.webp?v=1752648533","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/acae3e730ce074001d8bdc9295066b269b92be7d_451e4aa5-c4c1-42f7-8b42-ab37da6194ef.webp?v=1752648534","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d910ddf22fac45f8de1611f3b790186f4a999c_597fb692-2e2a-4b8d-acd9-54052a19a62e.webp?v=1752648534","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb59d24bc598ab72ade8ccad8599d3850d7397e_15b2b7a7-bcdc-4cb8-a578-dc044bae52f8.webp?v=1752648535","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29d795a478a222fe1fa4902911435b02a3a0bcaa_6f00b68b-59e0-40b6-a34a-a2f6ba3f6163.webp?v=1752648535","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc56d92383d505344587bf5d2b1ba1ba15187ad_b5a2e969-c433-417d-8573-92d000e05e55.webp?v=1752648536","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff76fe5062d1a39827bb0167b4e0d48b2eda4be3_ff460f8d-d70f-40ab-9480-97bfb6a43cee.webp?v=1752648536","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12312e6a0f5c91c99c46d9761334eb0364609ac7_aef59ace-7e38-474f-a9aa-697daadcbb26.webp?v=1752648537"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/edef41b54f80e131dc7e51a78003e6440c195f86.webp?v=1744703203","options":["color"],"media":[{"alt":null,"id":25495361683555,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/edef41b54f80e131dc7e51a78003e6440c195f86.webp?v=1744703203"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/edef41b54f80e131dc7e51a78003e6440c195f86.webp?v=1744703203","width":2000},{"alt":null,"id":25829484724323,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53d59572ccb1beadc5be28f8b1fe61e6f09db9a0_7321c2ee-bb4d-4fc0-8d8e-d3dd13cc3d9a.webp?v=1752648530"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53d59572ccb1beadc5be28f8b1fe61e6f09db9a0_7321c2ee-bb4d-4fc0-8d8e-d3dd13cc3d9a.webp?v=1752648530","width":2000},{"alt":null,"id":25829485183075,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7e6034f77d1e13fdfa9583fe5d420312a3d67af_0fc46221-8bb4-4e8b-b71c-88fcb56ea0fa.webp?v=1752648531"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7e6034f77d1e13fdfa9583fe5d420312a3d67af_0fc46221-8bb4-4e8b-b71c-88fcb56ea0fa.webp?v=1752648531","width":2000},{"alt":null,"id":25829485346915,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/689a3f31beb7509b16c09f630539ac25b2c8c6ce_bd29571a-d9ca-49e4-b3c4-1f03691dc1e0.webp?v=1752648532"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/689a3f31beb7509b16c09f630539ac25b2c8c6ce_bd29571a-d9ca-49e4-b3c4-1f03691dc1e0.webp?v=1752648532","width":2000},{"alt":null,"id":25829485543523,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4009f404e3cc06d2cfee8ea3f8c462a71ed74cc_6dafabcf-e735-4e7e-b239-21d8a9348ca6.webp?v=1752648533"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c4009f404e3cc06d2cfee8ea3f8c462a71ed74cc_6dafabcf-e735-4e7e-b239-21d8a9348ca6.webp?v=1752648533","width":2000},{"alt":null,"id":25829485707363,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/286d9b86b673859ab4551b8f179d466681060e4b_ec8fa658-e038-4e62-8fd7-a2513f0da54a.webp?v=1752648533"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/286d9b86b673859ab4551b8f179d466681060e4b_ec8fa658-e038-4e62-8fd7-a2513f0da54a.webp?v=1752648533","width":2000},{"alt":null,"id":25829485871203,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/acae3e730ce074001d8bdc9295066b269b92be7d_451e4aa5-c4c1-42f7-8b42-ab37da6194ef.webp?v=1752648534"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/acae3e730ce074001d8bdc9295066b269b92be7d_451e4aa5-c4c1-42f7-8b42-ab37da6194ef.webp?v=1752648534","width":2000},{"alt":null,"id":25829486329955,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d910ddf22fac45f8de1611f3b790186f4a999c_597fb692-2e2a-4b8d-acd9-54052a19a62e.webp?v=1752648534"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d910ddf22fac45f8de1611f3b790186f4a999c_597fb692-2e2a-4b8d-acd9-54052a19a62e.webp?v=1752648534","width":2000},{"alt":null,"id":25829486493795,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb59d24bc598ab72ade8ccad8599d3850d7397e_15b2b7a7-bcdc-4cb8-a578-dc044bae52f8.webp?v=1752648535"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb59d24bc598ab72ade8ccad8599d3850d7397e_15b2b7a7-bcdc-4cb8-a578-dc044bae52f8.webp?v=1752648535","width":2000},{"alt":null,"id":25829486690403,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29d795a478a222fe1fa4902911435b02a3a0bcaa_6f00b68b-59e0-40b6-a34a-a2f6ba3f6163.webp?v=1752648535"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29d795a478a222fe1fa4902911435b02a3a0bcaa_6f00b68b-59e0-40b6-a34a-a2f6ba3f6163.webp?v=1752648535","width":2000},{"alt":null,"id":25829486887011,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc56d92383d505344587bf5d2b1ba1ba15187ad_b5a2e969-c433-417d-8573-92d000e05e55.webp?v=1752648536"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9dc56d92383d505344587bf5d2b1ba1ba15187ad_b5a2e969-c433-417d-8573-92d000e05e55.webp?v=1752648536","width":2000},{"alt":null,"id":25829487083619,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff76fe5062d1a39827bb0167b4e0d48b2eda4be3_ff460f8d-d70f-40ab-9480-97bfb6a43cee.webp?v=1752648536"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff76fe5062d1a39827bb0167b4e0d48b2eda4be3_ff460f8d-d70f-40ab-9480-97bfb6a43cee.webp?v=1752648536","width":2000},{"alt":null,"id":25829487280227,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12312e6a0f5c91c99c46d9761334eb0364609ac7_aef59ace-7e38-474f-a9aa-697daadcbb26.webp?v=1752648537"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12312e6a0f5c91c99c46d9761334eb0364609ac7_aef59ace-7e38-474f-a9aa-697daadcbb26.webp?v=1752648537","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43302237700195,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF49","requires_shipping":true,"taxable":true,"featured_image":{"id":34196679852131,"product_id":7769417646179,"position":8,"created_at":"2025-07-16T14:48:52+08:00","updated_at":"2025-07-16T14:48:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d910ddf22fac45f8de1611f3b790186f4a999c_597fb692-2e2a-4b8d-acd9-54052a19a62e.webp?v=1752648534","variant_ids":[43302237700195]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle White Cat Flowers - 白貓花朵 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-XF49","featured_media":{"alt":null,"id":25829486329955,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d910ddf22fac45f8de1611f3b790186f4a999c_597fb692-2e2a-4b8d-acd9-54052a19a62e.webp?v=1752648534"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302243172451,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0126204-XF49","requires_shipping":true,"taxable":true,"featured_image":{"id":34196680409187,"product_id":7769417646179,"position":9,"created_at":"2025-07-16T14:48:53+08:00","updated_at":"2025-07-16T14:48:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb59d24bc598ab72ade8ccad8599d3850d7397e_15b2b7a7-bcdc-4cb8-a578-dc044bae52f8.webp?v=1752648535","variant_ids":[43302243172451]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle White Cat Flowers - 白貓花朵 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126204-XF49","featured_media":{"alt":null,"id":25829486493795,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb59d24bc598ab72ade8ccad8599d3850d7397e_15b2b7a7-bcdc-4cb8-a578-dc044bae52f8.webp?v=1752648535"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43302243336291,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01262J5-XF49","requires_shipping":true,"taxable":true,"featured_image":{"id":34196681326691,"product_id":7769417646179,"position":12,"created_at":"2025-07-16T14:48:54+08:00","updated_at":"2025-07-16T14:48:56+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff76fe5062d1a39827bb0167b4e0d48b2eda4be3_ff460f8d-d70f-40ab-9480-97bfb6a43cee.webp?v=1752648536","variant_ids":[43302243336291]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle White Cat Flowers - 白貓花朵 - 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":"NPB01262J5-XF49","featured_media":{"alt":null,"id":25829487083619,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ff76fe5062d1a39827bb0167b4e0d48b2eda4be3_ff460f8d-d70f-40ab-9480-97bfb6a43cee.webp?v=1752648536"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43302237700195,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0126224-XF49","requires_shipping":true,"taxable":true,"featured_image":{"id":34196679852131,"product_id":7769417646179,"position":8,"created_at":"2025-07-16T14:48:52+08:00","updated_at":"2025-07-16T14:48:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d910ddf22fac45f8de1611f3b790186f4a999c_597fb692-2e2a-4b8d-acd9-54052a19a62e.webp?v=1752648534","variant_ids":[43302237700195]},"available":true,"name":"iPhone 14 Pro Mod NX ilovedoodle White Cat Flowers - 白貓花朵 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0126224-XF49","featured_media":{"alt":null,"id":25829486329955,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9d910ddf22fac45f8de1611f3b790186f4a999c_597fb692-2e2a-4b8d-acd9-54052a19a62e.webp?v=1752648534"}},"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: "停產" }