diff --git a/CHANGELOG.md b/CHANGELOG.md index 18b7a94f..7d5ac1d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed a PHP error that would occur when importing Products that had new Variants. ([#1528](https://github.com/craftcms/feed-me/pull/1528)) - Fixed a bug where Lightswitch fields would not import correctly when nested in a Matrix or Super Table field. ([#1529](https://github.com/craftcms/feed-me/pull/1529)) +- Fixed a bug where Commerce Variant attributes were not respecting the `parseTwig` config setting. ([#1326](https://github.com/craftcms/feed-me/pull/1326)) ## 6.4.0 - 2024-09-25 diff --git a/src/elements/CommerceProduct.php b/src/elements/CommerceProduct.php index 4a4d34e2..c28b3019 100644 --- a/src/elements/CommerceProduct.php +++ b/src/elements/CommerceProduct.php @@ -424,6 +424,8 @@ private function _parseVariants($event): void } } + $parseTwig = Plugin::$plugin->service->getConfig('parseTwig', $feed['id']); + foreach ($variantData as $variantContent) { $attributeData = []; $fieldData = []; @@ -433,7 +435,7 @@ private function _parseVariants($event): void if (Hash::get($fieldInfo, 'attribute')) { $attributeValue = DataHelper::fetchValue(Hash::get($fieldInfo, 'data'), $fieldInfo, $this->feed); - $attributeData[$fieldHandle] = $attributeValue; + $attributeData[$fieldHandle] = $parseTwig ? DataHelper::parseFieldDataForElement($attributeValue, $this->element) : $attributeValue; } }