diff --git a/Plugin/Catalog/Helper/Product/Configuration/AroundGetCustomOptionsPlugin.php b/Plugin/Catalog/Helper/Product/Configuration/AroundGetCustomOptionsPlugin.php index 846a22c..db6e729 100644 --- a/Plugin/Catalog/Helper/Product/Configuration/AroundGetCustomOptionsPlugin.php +++ b/Plugin/Catalog/Helper/Product/Configuration/AroundGetCustomOptionsPlugin.php @@ -45,14 +45,14 @@ public function aroundGetCustomOptions( $attributes = $this->getVisibleCheckoutAttributesService->execute(); if (count($attributes) > 0) { - foreach ($attributes as $attributeCode => $attributeLabel) { - $value = $item->getProduct()->getData($attributeCode); + foreach ($attributes as $attributeCode => $attribute) { + $value = $attribute->getFrontend()->getValue($item->getProduct()); if (!$value) { continue; } $options[] = [ - 'label' => $attributeLabel, + 'label' => $attribute->getStoreLabel(), 'value' => $value, 'print_value' => $value ]; diff --git a/Plugin/Catalog/Model/Attribute/AroundGetAttributeNamesPlugin.php b/Plugin/Catalog/Model/Attribute/AroundGetAttributeNamesPlugin.php index c936cb7..4b52720 100644 --- a/Plugin/Catalog/Model/Attribute/AroundGetAttributeNamesPlugin.php +++ b/Plugin/Catalog/Model/Attribute/AroundGetAttributeNamesPlugin.php @@ -41,7 +41,7 @@ public function aroundGetAttributeNames(\Magento\Catalog\Model\Attribute\Config if ($groupName == 'quote_item') { $attributes = $this->getVisibleCheckoutAttributesService->execute(); - foreach ($attributes as $attributeCode => $attributeLabel) { + foreach ($attributes as $attributeCode => $attribute) { $attributeNames[] = $attributeCode; } } diff --git a/Service/GetVisibleCheckoutAttributesService.php b/Service/GetVisibleCheckoutAttributesService.php index 1baf74f..1d1d759 100644 --- a/Service/GetVisibleCheckoutAttributesService.php +++ b/Service/GetVisibleCheckoutAttributesService.php @@ -46,9 +46,9 @@ public function execute() $options = []; if (count($attributes->getItems()) > 0) { foreach ($attributes->getItems() as $attribute) { - /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $handle */ + /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ - $options[$attribute->getAttributeCode()] = $attribute->getDefaultFrontendLabel(); + $options[$attribute->getAttributeCode()] = $attribute; } }