Skip to content

Commit 9854625

Browse files
authored
Merge pull request #228 from webidea24/task/sku
respect bundle dynamic-sku
2 parents 45e708c + 88e5ddd commit 9854625

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Plugin/Catalog/Helper/Product/Configuration/AddVisibleInCheckoutAttributesToCustomOptionsPlugin.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ public function __construct(GetVisibleCheckoutAttributesServiceInterface $getVis
4242
public function afterGetCustomOptions(Configuration $configuration, array $customOptions, ItemInterface $item)
4343
{
4444
$attributes = $this->getVisibleCheckoutAttributesService->execute();
45-
foreach ($attributes as $attribute) {
46-
$value = $attribute->getFrontend()->getValue($item->getProduct());
45+
foreach ($attributes as $attributeCode => $attribute) {
46+
if ($attributeCode === 'sku') {
47+
$value = $item->getProduct()->getSku();
48+
} else {
49+
$value = $attribute->getFrontend()->getValue($item->getProduct());
50+
}
51+
4752
if (!$value) {
4853
continue;
4954
}

0 commit comments

Comments
 (0)