From c39763917662f924c974171391187f4b5378c589 Mon Sep 17 00:00:00 2001 From: dwindown Date: Thu, 20 Nov 2025 01:02:14 +0700 Subject: [PATCH] debug: Log all variation meta to find correct attribute storage key Added logging to see ALL meta keys and values for variations. This will show us exactly how WooCommerce stores the attribute values. Check debug.log for: Variation #362 ALL META: Array(...) This will reveal the actual meta key format. --- includes/Api/ProductsController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/Api/ProductsController.php b/includes/Api/ProductsController.php index 4d9a373..d391db6 100644 --- a/includes/Api/ProductsController.php +++ b/includes/Api/ProductsController.php @@ -599,6 +599,10 @@ class ProductsController { // Format attributes with human-readable names and values $formatted_attributes = []; + // Debug: Log all meta for this variation + $all_meta = get_post_meta($variation_id); + error_log("Variation #{$variation_id} ALL META: " . print_r($all_meta, true)); + // Get parent product attributes to know what to look for $parent_attributes = $product->get_attributes();