attribute = $attribute; $this->scopeConfig = $scopeConfig; } public function toOptionArray() { $options = []; $attributeCode = $this->scopeConfig->getValue('cpcommerce_shipping_notifications/general/attribute',\Magento\Store\Model\ScopeInterface::SCOPE_STORE); $shippingCategories = $this->attribute->get($attributeCode)->getOptions(); foreach($shippingCategories AS $shippingCategory){ $options[] = [ 'value' => $shippingCategory->getValue(), 'label' => $shippingCategory->getLabel() ]; } return $options; } }