Markus Michalski FAQ

Warenkorb- & Checkout-Attribute: Shop API

Shop-API-Endpunkte für den Kill-Switch und die Anzeige-Konfiguration pro Produktattribut, Filter und Fehlerverhalten des Sylius-Plugins.

English Version

Zurück zur Übersicht

Warenkorb- & Checkout-Attribute: Shop API

Endpunkte

Methode Pfad Beschreibung
GET /api/v2/shop/cart-checkout-attributes-settings Liefert den Kill-Switch-Zustand
GET /api/v2/shop/cart-checkout-attribute-display-configs Collection aller Anzeige-Konfigurationen, filterbar
GET /api/v2/shop/cart-checkout-attribute-display-configs/{id} Einzelne Anzeige-Konfiguration

Alle drei Endpunkte sind öffentlich erreichbar (PUBLIC_ACCESS, wie jede andere Shop-API-Ressource) und reine Nur-Lese-Endpunkte - es gibt kein POST/PUT, Schreibzugriff läuft ausschließlich über das Admin-Formular.

Felder

cart-checkout-attributes-settings

Feld Typ Beschreibung
active bool Kill-Switch-Zustand

cart-checkout-attribute-display-configs

Feld Typ Beschreibung
attribute IRI Verweis auf /api/v2/shop/product-attributes/{code}
visibleInCart bool Entspricht dem Admin-Feld „Im Warenkorb anzeigen“
checkoutVisibility string not_visible | visible | mandatory

Filter

curl "https://shop.example.com/api/v2/shop/cart-checkout-attribute-display-configs?attribute.code=material"

Der Filter nutzt #[ApiFilter(SearchFilter::class)], ein seit API Platform 4.4 als veraltet markiertes Attribut (abgelöst durch #[QueryParameter]). Es wird bewusst für die Abwärtskompatibilität zu API Platform 4.2 beibehalten.

Fehlerverhalten

Situation Einstellungs-Endpunkt Display-Config-Endpunkt
Tabelle existiert nicht (Migration fehlt) degradiert auf active: false leere Collection / 404 statt 500
Erwartete Spalte fehlt (unvollständige Migration) - leere Collection / 404 statt 500
sonstiger Datenbankfehler degradiert auf active: false 500 (bewusst, da „Pflicht“-Flags rechtlich relevant sind)
curl "https://shop.example.com/api/v2/shop/cart-checkout-attributes-settings"
# {"active": true}