Skip to content

variationen Endpunkt korrektur#238

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

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>
@Avatarsia
Copy link
Copy Markdown
Contributor Author

Superseded by #266 — die Batch-Stock-Sync-Refactorisierung ersetzt ImportSendListLager komplett und deckt die Variation-Unterstützung bereits über den offiziellen products/{parent}/variations/batch-Endpoint ab. Die Variation-Orders werden damit nicht mehr per Einzelrequest aktualisiert, sondern im gleichen Batch-Zyklus mit bis zu 100 Einträgen pro Roundtrip.

Closing to avoid duplicate implementations of the same code path.

@Avatarsia Avatarsia closed this Apr 21, 2026
Avatarsia pushed a commit to Avatarsia/OpenXE that referenced this pull request Apr 21, 2026
PR OpenXE-org#266 (feature/woocommerce-batch-stock-sync) rewrites ImportSendListLager
onto products/batch + variations/batch and therefore covers the variation
support of OpenXE-org#238 as a strict superset — with a 100x reduction in request
count on top. Keeping both in the manifest produced a semantic conflict
on the stock sync code path during Pass 2.

Upstream PR OpenXE-org#238 was closed with a superseded-by note. If upstream still
chooses to merge OpenXE-org#238 first, the production rebuild can be reverted by
adding the line back.
Avatarsia pushed a commit to Avatarsia/OpenXE that referenced this pull request Apr 21, 2026
PR OpenXE-org#266 (feature/woocommerce-batch-stock-sync) rewrites ImportSendListLager
onto products/batch + variations/batch and therefore covers the variation
support of OpenXE-org#238 as a strict superset — with a 100x reduction in request
count on top. Keeping both in the manifest produced a semantic conflict
on the stock sync code path during Pass 2.

Upstream PR OpenXE-org#238 was closed with a superseded-by note. If upstream still
chooses to merge OpenXE-org#238 first, the production rebuild can be reverted by
adding the line back.
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