Object-oriented programming(OOP) Language is a programming style, considered more efficient and advanced than procedural language.
Object-oriented programming languages include C#, Java, Ruby, PHP, C++. Procedural programming is the standard approach used in traditional computer languages C, FORTAN, Pascal.
When our project grow in more complexity, we opt to choose Object-oriented programming rather than Procedural programming.
An Object-oriented application uses a collection of objects, which communicate by passing messages to request services. The aim of Object-oriented programming is to try to increase the flexibility, re-usability and maintainability of programs.
Some of basic concepts of Object-oriented programming was class, object, abstraction, inheritance, interface, polymorphism.
protected function _prepareCollection()
$collection = Mage::getResourceModel($this->_getCollectionClass());
$resource = Mage::getSingleton('core/resource');
$orderReference = $resource->getTableName('sales/order');
$collection->getSelect()->join(array('so' => $orderReference),'main_table.entity_id = so.entity_id',array(''))
->columns('(CASE WHEN so.is_virtual = 1 THEN "Virtual Order" ELSE "Shipping Order" END) AS order_mode');
protected function _prepareColumns()
//Place code where you need to show field
'header' => Mage::helper('sales')->__('Order Mode'),
'index' => 'order_mode',
'type' => 'text',
'width' => '70px',
'filter' => false,
'sortable' => false,
While searching sales orders list, you are getting error as “Integrity constraint violation: 1052 Column ‘increment_id’ in where clause is ambiguous”. To resolve those errors add “filter_index” at required add column function. Use below code for increment id error, do same for “created_at”,”grand_total”,..