Open
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Lagerbestand, Status) übertragen — Name, Beschreibung etc. werden vom Parent vererbt.
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.