From 5b4582b098f08683eb6a21f32b79ea2d0656d141 Mon Sep 17 00:00:00 2001 From: "pawel.gaca" Date: Thu, 4 Dec 2025 15:23:52 +0100 Subject: [PATCH] bugfix xmltographql --- XMLtoGraphQL/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XMLtoGraphQL/script.js b/XMLtoGraphQL/script.js index e56e28f..5f52e05 100644 --- a/XMLtoGraphQL/script.js +++ b/XMLtoGraphQL/script.js @@ -1,11 +1,11 @@ function idmGetGrossNetPrices({priceNode, name}){ return { gross: { - value: priceNode?.getAttribute(`${name}`) !== null ? +priceNode.getAttribute(`${name}`) : undefined, + value: priceNode?.getAttribute(`${name}`) !== null ? +priceNode?.getAttribute(`${name}`) : undefined, formatted: priceNode?.getAttribute(`${name}_formatted`) ?? undefined, }, net: { - value: priceNode?.getAttribute(`${name}_net`) !== null ? +priceNode.getAttribute(`${name}_net`) : undefined, + value: priceNode?.getAttribute(`${name}_net`) !== null ? +priceNode?.getAttribute(`${name}_net`) : undefined, formatted: priceNode?.getAttribute(`${name}_net_formatted`) ?? undefined, } } @@ -193,7 +193,7 @@ async function idmGetGraphQLData(link){ sizesNode.querySelectorAll(":scope > size").forEach(size=>{ const availabilityNode = size.querySelector(":scope > availability"); const shippingTimeNode = availabilityNode.querySelector(":scope > shipping_time"); - const sizePriceNode = availabilityNode.querySelector(":scope > price"); + const sizePriceNode = size.querySelector(":scope > price"); const weightNode = size.querySelector(":scope > weight"); sizes.push({