attributes = $collectionFactory; } /** * Get options. * * @return array */ public function toOptionArray() { $attributes = $this->attributes ->create() ->addVisibleFilter(); $attributeArray = []; $attributeArray[] = [ 'label' => __('---- Default Option ----'), 'value' => '0', ]; foreach ($attributes as $attribute) { $attributeCode = $attribute->getAttributeCode(); if (!in_array($attributeCode, $this->excluded)) { $attributeArray[] = [ 'label' => $attribute->getFrontendLabel(), 'value' => $attributeCode, ]; } } return $attributeArray; } }