Hallo, wenn ich Artikel mit Varianten über die REST API anlegen möchte, erhalte ich diese Fehlermeldung: Errormesage: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‚5-Blau‘ for key ‚group_id‘ Ich verwende diese Daten zum anlegen des Artikels: { "name": "Speed 7 Jacke Kansas - grau", "descriptionLong": "Winddichte Windjacke", "mainDetail": { "number": "VAR1000", "inStock": "9" }, "active": "1", "tax": "19", "supplier": "Speed 7", "categories": { "id": "1264" }, "configuratorSet": { "groups": [{ "name": "Größe", "options": { "name": [ "XS", "S", "L", "XL", "XXL", "XXXL"] } }, { "name": "Farbe", "options": { "name": ["Blau", "Rot", "Grau"] } } ] }, "variants": [{ "isMain": "1", "number": "VAR1000\_BXS", "inStock": "3", "configuratorOptions": [ { "group": "Größe", "option": "XS" }, { "group": "Farbe", "option": "Blau" }], "additionaltext": "XS Blau" }, { "isMain": "0", "number": "VAR1000\_RXS", "inStock": "3", "configuratorOptions": [{ "group": "Größe", "option": "XS" }, { "group": "Farbe", "option": "Rot" }], "additionaltext": "XS Rot" }, { "isMain": "0", "number": "VAR1000\_GXL", "inStock": "3", "configuratorOptions": [{ "group": "Größe", "option": "XL" }, { "group": "Farbe", "option": "Grau" }], "additionaltext": "XL Grau" } ] }
Was stimmt hier nicht? Gruß, Anton
Hallo, gibt es eine Lösung dafür? Gruß, Anton
Hallo, es fehlten unter anderem eckige Klammern, mit denen Arrays definiert werden. So funktioniert es: { "name": "Speed 7 Jacke Kansas - grau", "descriptionLong": "Winddichte Windjacke", "mainDetail": { "number": "VAR1000", "inStock": "9", "prices": [{ "customerGroupKey": "EK", "price": "149", "from": "1" }] }, "active": "1", "tax": "19", "categories": [{ "id": "206" }], "configuratorSet": { "groups": [{ "name": "Größe", "options": [ { "name": "XS" }, { "name": "S" }, { "name": "L" }, { "name": "XL" }, { "name": "XXL" }, { "name": "XXXL" }] }, { "name": "Farbe", "options": [{ "name": "Blau" }, { "name": "Rot" }, { "name": "Grau" }] } ] }, "variants": [{ "number": "VAR1000\_BXS", "inStock": "3", "configuratorOptions": [ { "group": "Größe", "option": "XS" }, { "group": "Farbe", "option": "Blau" }], "additionaltext": "XS Blau", "prices": [{ "customerGroupKey": "EK", "price": "149", "from": "1" }] }, { "number": "VAR1000\_RXS", "inStock": "3", "configuratorOptions": [{ "group": "Größe", "option": "XS" }, { "group": "Farbe", "option": "Rot" }], "additionaltext": "XS Rot", "prices": [{ "customerGroupKey": "EK", "price": "149", "from": "1" }] }, { "number": "VAR1000\_GXL", "inStock": "3", "configuratorOptions": [{ "group": "Größe", "option": "XL" }, { "group": "Farbe", "option": "Grau" }], "additionaltext": "XL Grau", "prices": [{ "customerGroupKey": "EK", "price": "149", "from": "1" }] } ] }
Gruß, Anton