In Bearbeitung Amazon Custom - Eigene Übersichten Ansicht - Mehr als eine Bestellpositionen

Dano

Gut bekanntes Mitglied
30. Oktober 2016
140
18
Moin moin,

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

1606475605910.png

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
 

Reskey

Aktives Mitglied
20. Mai 2019
18
3
würde hierfür auch gerne eine Lösung haben, leider wird im Guide dieses Problem/Szenario nicht behandelt
 

Dano

Gut bekanntes Mitglied
30. Oktober 2016
140
18
würde hierfür auch gerne eine Lösung haben, leider wird im Guide dieses Problem/Szenario nicht behandelt

Versuch mal folgenden Code:

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].optionValue')
IS NOT NULL

THEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[0].optionValue') END AS [Motiv],

CASE WHEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[1].fontFamily') IS NOT NULL
THEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[1].fontFamily') END AS [Schriftart],

CASE WHEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[1].text') IS NOT NULL
THEN JSON_VALUE(pf_amazon_bestellungpos.cCustomJson, '$.data.orderCustomizationData[0].customizationInfo."version3.0".surfaces[0].areas[1].text') END AS [Text]


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
 
  • Gefällt mir
Reaktionen: Reskey

Ähnliche Themen