Search code examples
phpmagento

Magento Override Existing Source Model


I want to add one more option in Mage_CatalogInventory_Model_Source_Backorders.How do I override this source model?

Is overriding similar to Entity model override?


Solution

  • Correct. The xpath is global/models/cataloginventory/rewrite/source_backorders. Depending on your sorting needs/preference, simply array_merge(), array_unshift(), or array_splice() your option where it needs to go in the overridden toOptionArray() method.