Skip to content

variationen Endpunkt korrektur#238

Open
Avatarsia wants to merge 2 commits intoOpenXE-org:masterfrom
Avatarsia:fix/woocommerce-variation-support
Open

variationen Endpunkt korrektur#238
Avatarsia wants to merge 2 commits intoOpenXE-org:masterfrom
Avatarsia:fix/woocommerce-variation-support

Conversation

@Avatarsia
Copy link
Copy Markdown
Contributor

Zusammenfassung
WooCommerce-Produktexport schlug mit 404-Fehler fehl, wenn Produktvarianten aktualisiert werden sollten. Die WC REST API erfordert für Varianten den Endpunkt
/products/{parent_id}/variations/{id} statt /products/{id}.

Änderungen

  • Produkt-Update: Varianten werden jetzt über den korrekten Variations-Endpunkt aktualisiert. Dabei werden nur die für Varianten relevanten Attribute (Preis, Gewicht, Maße,
    Lagerbestand, Status) übertragen — Name, Beschreibung etc. werden vom Parent vererbt.
  • Kategorie-Sync: Kategorien gehören in WooCommerce zum Parent-Produkt, nicht zur Variante. GET und PUT für Kategoriezuweisungen verwenden jetzt die Parent-ID bei Varianten.
  • Lager-Sync hatte diese Logik bereits korrekt implementiert — die Produktdaten- und Kategorie-Synchronisation ist nun gleichgezogen.

Hintergrund

Betroffen waren alle Varianten-Artikel beim Shop-Export. Einfache Produkte waren nicht betroffen. Die Fehlermeldung von WooCommerce war:
▎ Um Produktvarianten zu bearbeiten, sollten Sie den Endpunkt /products/<product_id>/variations/ verwenden.

Avatarsia and others added 2 commits March 24, 2026 19:28
…export

Categories belong to the parent product in WooCommerce, not to variations.
Use $category_product_id (parent ID for variants, product ID for simple
products) for both GET and PUT category operations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Variable products (type=variable) in WooCommerce manage stock on the
variation level, not the parent. When a parent product is detected,
fetch all variations and set stock_quantity on each one individually.

Also exposes product type from getShopIdBySKU() for downstream logic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant