Skip to content

Commit

Permalink
Merge branch '5.x' into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybrad committed Oct 9, 2024
2 parents 28b4c57 + 7b0737e commit 2d35863
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion src/elements/CommerceProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ private function _parseVariants($event): void
}
}

$parseTwig = Plugin::$plugin->service->getConfig('parseTwig', $feed['id']);

foreach ($variantData as $variantContent) {
$attributeData = [];
$fieldData = [];
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 2d35863

Please sign in to comment.