fix: variant update now sets attribute values and default variant on WC

- Update path sends attributes per variation (was missing, causing
  "Any COLOR..." on WC)
- Sets default_attributes on parent product (first variant's values)
- Better API error logging with response body

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-01 18:20:52 -04:00
parent 8983c8bd50
commit 39d4fe5020
2 changed files with 34 additions and 6 deletions

View File

@@ -39,6 +39,11 @@ class WooApiClient:
params=params,
timeout=self.timeout,
)
if response.status_code >= 400:
_logger.error(
"WC API %s %s returned %s: %s",
method, endpoint, response.status_code, response.text[:500],
)
response.raise_for_status()
return response.json()
except Exception as exc: