I have an issue ; Deprecated Functionality: explode(): Passing null to parameter #2 ($string). Can you please help?
public function getEnabled()
{
return $this->_dataHelper->getEnabled();
}
public function getRenderableAttributes()
{
if (!$this->getEnabled()) {
return [];
}
$attributeCode = $this->_dataHelper->getAttributeCode();
$product = $this->getProduct();
$selectedFeaturesRaw = $product->getData($attributeCode);
$selectedFeaturesSplit = explode(',', $selectedFeaturesRaw);
$attr = $product->getResource()->getAttribute($attributeCode);
$selectedFeatures = [];
foreach ($selectedFeaturesSplit as $selectedFeatureCode) {
if ($attr->usesSource()) {
$selectedFeatures[] = $attr->getSource()->getOptionText($selectedFeatureCode);
}
}
if (empty($selectedFeatures)) {
return [];
}
$features = [];
$searchCriteria = $this->_searchCriteriaBuilder->addFilter('attribute_value', $selectedFeatures, 'in')->create();
$searchResults = $this->_dataRepository->getList($searchCriteria);
$features = array_map(function ($feature) {
return $feature->getData();
}, $searchResults->getItems());
return $features;
}