priceUnitLabel = $priceUnitLabel; } /** * @inheritdoc */ public function getData( QuoteItem $cartItem, Option $option, SelectedOption $selectedOption ): array { $selectedOptionValueData = []; $optionIds = explode(',', $selectedOption->getValue()); if (0 === count($optionIds)) { return $selectedOptionValueData; } foreach ($optionIds as $optionId) { $optionValue = $option->getValueById($optionId); $priceValueUnits = $this->priceUnitLabel->getData($optionValue->getPriceType()); $selectedOptionValueData[] = [ 'id' => $selectedOption->getId(), 'label' => $optionValue->getTitle(), 'price' => [ 'type' => strtoupper($optionValue->getPriceType()), 'units' => $priceValueUnits, 'value' => $optionValue->getPrice(), ], ]; } return $selectedOptionValueData; } }