Bat-Chat
4/22/2016 - 9:17 AM

Get order_payment collection (like)

Get order_payment collection (like)

$conditions = array();
$words = preg_split( "/([ ]+|[-]+|[_]+)/", $value);
foreach( $words as $value ){
    $conditions[] = array('like' => "%{$value}%");
}

$paymentTableName = Mage::getSingleton('core/resource')->getTableName('sales/order_payment');
$this->getCollection()->addFieldToFilter(
    "{$paymentTableName}.method",
    array('like' => "%{$value}%")
);