public function getAttributeAutocompleteField(\Magento\Catalog\Api\Data\ProductAttributeInterface $attribute) { $fieldName = $attribute->getAttributeCode(); if ($attribute->usesSource()) { $fieldName = $this->mappingHelper->getOptionTextFieldName($fieldName); } return $fieldName; }
/** * Get filter field for an attribute. * * @param Magento\Catalog\Model\ResourceModel\Product\Attribute $attribute Product attribute. * * @return string */ private function getFilterField($attribute) { return $this->autocompleteHelper->getAttributeAutocompleteField($attribute); }