addressMetadata = $addressMetadata; $this->escaper = $escaper; } /** * Returns frontend label for attribute. * * @param string $attributeCode * @return string * @throws LocalizedException */ public function getFrontendLabel(string $attributeCode): string { try { $attribute = $this->addressMetadata->getAttributeMetadata($attributeCode); $frontendLabel = $attribute->getFrontendLabel(); } catch (NoSuchEntityException $e) { $frontendLabel = ''; } return $this->escaper->escapeHtml(__($frontendLabel)); } }