سؤال

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

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top