Liebes OXID-Forum,
wie kann man mit GraphQL auf die Attribute einer Category zugreifen?
Bei Produkte funktioniert dies wie folgt:
query {
products{
title
attributes {
attribute{
title
}
value
}
}
}
Im Datentyp “Categories” scheint es jedoch keine “category.attributes” zu geben. Wie ist es möglich darauf zuzugreifen?
Danke & viele Grüße
es gibt keine kategorie Attribute, es sind dort immer noch artikel Attribute, du wirst also auch dort auf die artikel gehen muessen.
Hi @draufgeschaut ,
in OXID gibt es Kategories Attributes: OXID eShop CE: OxidEsales\EshopCommunity\Application\Model\Category Class Reference
Diese unterscheiden sich von den Produkt Attributes.
über die kategorie kann man nur die zuordnung steuern ( tabelle attribute2category )
bheyse
December 22, 2022, 10:15pm
5
Jup ! Und nu schöne Feiertage!
Kategorie Attribute gibt es: hat man z.B. eine Kategorie “T-Shirt”, dann gibt es für das Attribute “Farbe” die Werte [“blau”, “rot”, “grün”]. Diese Values werden benötigt, um die Facetten eines Webshops zu zeichnen.
Ein T-Shirt Produkt hat für das Attribute “Farbe” z.B. den Wert “rot”.
Für die Implementierung der Kategorie Attribute habe ich einen Pull-Request für das OXID Graphql-Storefront Modul erstellt:
OXID-eSales:b-6.5.x
← danbeck:b-6.5.x
opened 12:49PM - 06 Jan 23 UTC
This pull requests adds the CategoryAttribute data type. It extends the GraphQL … schema to retrieve category attributes as follows:
```
query {
categories(filter:{
title:{
equals: "test"
}
}) {
id
title
longDescription
thumbnail
root {
id
}
seo {
description
url
}
attributes {
attribute{
title
}
values
}
}
}
```
Notice: The DataType Attribute was changed too, because attribute->getRawFieldData('oxtitle') returns null for categories: https://github.com/OXID-eSales/graphql-storefront-module/compare/b-6.5.x...danbeck:graphql-storefront-module:b-6.5.x?expand=1#diff-53162643b996768dd58dba6a7664e935810b8103631e3357070a121cd7afeccfR40
system
Closed
January 12, 2024, 10:54am
7
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.