Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  3. <module name="Vendor_Module" setup_version="2.1.0">
  4. <sequence>
  5. <module name="Magento_Review"/>
  6. </sequence>
  7. </module>
  8. </config>
  9.  
  10. <?xml version="1.0"?>
  11. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  12. <preference for="MagentoReportsBlockAdminhtmlReviewCustomer" type="VendorModuleBlockAdminhtmlReviewCustomer" />
  13. <preference for="MagentoReportsModelResourceModelReviewCustomerCollection" type="VendorModuleModelResourceModelReviewCustomerCollection" />
  14. </config>
  15.  
  16. <?php
  17.  
  18. namespace VendorModuleBlockAdminhtmlReview;
  19.  
  20. class Customer extends MagentoReportsBlockAdminhtmlReviewCustomer
  21. {
  22. protected function _prepareLayout()
  23. {
  24. parent::_prepareLayout();
  25.  
  26. $customerNameColumn = $this->getChildBlock('grid')
  27. ->getChildBlock('grid.columnSet')
  28. ->getChildBlock('customer_name');
  29. $customerNameColumn->setFilterIndex([
  30. 'customer.firstname',
  31. 'customer.lastname'
  32. ]);
  33.  
  34. return $this;
  35. }
  36. }
  37.  
  38. <?php
  39. namespace VendorModuleModelResourceModelReviewCustomer;
  40.  
  41. class Collection extends MagentoReportsModelResourceModelReviewCustomerCollection
  42. {
  43. public function addFieldToFilter($field, $condition = null)
  44. {
  45. if (is_array($field) && array_key_exists('like', $condition)) {
  46. $condition = array_fill(0, count($field), $condition);
  47. }
  48.  
  49. return parent::addFieldToFilter($field, $condition);
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement