Frage

hello everyone i am using magento 2.1 in my case i want to override a model class in my custom module , but the override didn't toke correctly

War es hilfreich?

Lösung

If You don't want to change existing Statuses, just add new.
You should use DI for that with afterToOptionArray(\Magento\Sales\Model\Config\Source\Order\Status $subject, array $result).
and inside just prepare and add new status to $result array. And of course return it.

How To use DI? It's pretty simple. Just read
https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange
scroll top