From 77d63b1caddb9e62528555e0ed58a38bdbb6f2a6 Mon Sep 17 00:00:00 2001 From: Pichinov-Jose Date: Sat, 12 Sep 2026 19:20:01 +0200 Subject: [PATCH] FIX keep the variation attribute value when a custom attribute shadows a taxonomy When a variation carries a custom attribute (attribute_xxx) while a taxonomy of the same name (pa_xxx) exists, getValueByCode() looks the value up in the taxonomy, finds nothing, and the name comes back empty. The variation is then exported with no value at all, and targets that require one reject the whole product. Fall back on the raw value the variation actually holds. Closes #11 Co-Authored-By: Claude Opus 5 --- src/Objects/Product/Variants/AttributesTrait.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Objects/Product/Variants/AttributesTrait.php b/src/Objects/Product/Variants/AttributesTrait.php index ee6ce60..a6a276e 100644 --- a/src/Objects/Product/Variants/AttributesTrait.php +++ b/src/Objects/Product/Variants/AttributesTrait.php @@ -234,6 +234,19 @@ private function getVariantsAttributesField(string $fieldId, string $code, strin // Load Attribute $attribute = Manager::getValueByCode($code, $name); $attributeName = $attribute->name ?? ""; + //====================================================================// + // Group found, value not resolved: fall back on the raw value. + // + // The variation carries a custom attribute (attribute_xxx) while a + // taxonomy of the same name (pa_xxx) exists. getValueByCode() looks the + // value up in the taxonomy, finds nothing, and the name comes back + // empty — so the variation is exported with no value at all, and + // targets that require one reject the whole product. + // + // The raw value the variation actually holds is the right answer here. + if (!$attribute) { + $attributeName = $name; + } //====================================================================// // Read Mono-lang Values