Moin moin,
es wird keine Info angezeigt, wenn die Bestellung z.B. zwei Auftragspositionen hat.

Wir nutzen den SQL Code aus der Dokumentation.
https://guide.jtl-software.de/jtl-eazyauction/bei-amazon-verkaufen/amazon-custom/
Wie muss man den SQL Code anpassen, damit die Amazon Custom Info für jede Auftragsposition angezeigt wird?
--------------------
IF
(
SELECT ncustom
FROM tBestellung
JOIN pf_amazon_bestellung ON pf_amazon_bestellung.cOrderId = tBestellung.cInetBestellNr
JOIN pf_amazon_bestellungpos ON pf_amazon_bestellungpos.kAmazonBestellung = pf_amazon_bestellung.kAmazonBestellung
WHERE tbestellung.kBestellung = @Key
)
IS NULL
SELECT 'Der ausgewählte Auftrag ist keine Amazon Custom Bestellung' AS Informationsausgabe
ELSE BEGIN
(
SELECT
tbestellung.cInetBestellNr AS 'Bestellnummer Amazon',
tbestellung.cBestellNr AS 'Eigene Auftragsnummer',
pf_amazon_bestellungpos.cOrderItemId AS 'ItemId Amazon',
pf_amazon_bestellungpos.cArtNr AS 'Amazon SKU',
pf_amazon_bestellungpos.nQuantityPurchased AS 'Menge',
CASE WHEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[0].fontFamily') IS NOT NULL
THEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[0].fontFamily') END AS [Wert 1 - Schriftart],
CASE WHEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[0].text') IS NOT NULL
THEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[0].text') END AS [Wert 2 - Name],
CASE WHEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[1].optionValue') IS NOT NULL
THEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[1].optionValue') END AS [Wert 3 - Farbe]
FROM tbestellung
JOIN tbestellpos on tbestellpos.tBestellung_kBestellung = tbestellung.kBestellung
JOIN pf_amazon_bestellungpos on pf_amazon_bestellungpos.kAmazonBestellungPos = tbestellpos.kAmazonBestellungPos
WHERE tbestellung.kBestellung = @Key
)
END
es wird keine Info angezeigt, wenn die Bestellung z.B. zwei Auftragspositionen hat.

Wir nutzen den SQL Code aus der Dokumentation.
https://guide.jtl-software.de/jtl-eazyauction/bei-amazon-verkaufen/amazon-custom/
Wie muss man den SQL Code anpassen, damit die Amazon Custom Info für jede Auftragsposition angezeigt wird?
--------------------
IF
(
SELECT ncustom
FROM tBestellung
JOIN pf_amazon_bestellung ON pf_amazon_bestellung.cOrderId = tBestellung.cInetBestellNr
JOIN pf_amazon_bestellungpos ON pf_amazon_bestellungpos.kAmazonBestellung = pf_amazon_bestellung.kAmazonBestellung
WHERE tbestellung.kBestellung = @Key
)
IS NULL
SELECT 'Der ausgewählte Auftrag ist keine Amazon Custom Bestellung' AS Informationsausgabe
ELSE BEGIN
(
SELECT
tbestellung.cInetBestellNr AS 'Bestellnummer Amazon',
tbestellung.cBestellNr AS 'Eigene Auftragsnummer',
pf_amazon_bestellungpos.cOrderItemId AS 'ItemId Amazon',
pf_amazon_bestellungpos.cArtNr AS 'Amazon SKU',
pf_amazon_bestellungpos.nQuantityPurchased AS 'Menge',
CASE WHEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[0].fontFamily') IS NOT NULL
THEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[0].fontFamily') END AS [Wert 1 - Schriftart],
CASE WHEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[0].text') IS NOT NULL
THEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[0].text') END AS [Wert 2 - Name],
CASE WHEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[1].optionValue') IS NOT NULL
THEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[1].optionValue') END AS [Wert 3 - Farbe]
FROM tbestellung
JOIN tbestellpos on tbestellpos.tBestellung_kBestellung = tbestellung.kBestellung
JOIN pf_amazon_bestellungpos on pf_amazon_bestellungpos.kAmazonBestellungPos = tbestellpos.kAmazonBestellungPos
WHERE tbestellung.kBestellung = @Key
)
END