Skip to content

Instantly share code, notes, and snippets.

@Bat-Chat
Last active July 30, 2016 22:07
Show Gist options
  • Save Bat-Chat/a6e967bac4a39c6d5e4cdd9424dd1c02 to your computer and use it in GitHub Desktop.
Save Bat-Chat/a6e967bac4a39c6d5e4cdd9424dd1c02 to your computer and use it in GitHub Desktop.
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}%")
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment