File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
app/code/Magento/AdvancedPricingImportExport/Controller/Adminhtml/Export Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,28 @@ public function execute()
34
34
/** @var $export \Magento\ImportExport\Model\Export */
35
35
$ export = $ this ->_objectManager ->create (\Magento \ImportExport \Model \Export::class);
36
36
$ export ->setData ($ data );
37
+ $ filter = (isset ($ data ['filter ' ]) && $ data ['filter ' ]) ? $ data ['filter ' ] : null ;
38
+ $ collection = $ export ->getEntityAttributeCollection ();
39
+ if (!is_null ($ filter )) {
40
+ $ filters = array_reduce (
41
+ explode ('& ' , base64_decode ($ filter )),
42
+ function ($ filter , $ item ) {
43
+ list ($ key , $ value ) = explode ('= ' , $ item , 2 );
44
+ $ filter [$ key ] = $ value ;
45
+ return $ filter ;
46
+ },
47
+ []
48
+ );
49
+ foreach ($ filters as $ field => $ value ) {
50
+ foreach ($ collection as $ attribute ) {
51
+ if (stripos ($ attribute ->getData ($ field ), $ value ) === false ) {
52
+ $ collection ->removeItemByKey ($ attribute ->getId ());
53
+ }
54
+ }
55
+ }
56
+ }
37
57
$ export ->filterAttributeCollection (
38
- $ attrFilterBlock ->prepareCollection ($ export -> getEntityAttributeCollection () )
58
+ $ attrFilterBlock ->prepareCollection ($ collection )
39
59
);
40
60
return $ resultLayout ;
41
61
} catch (\Exception $ e ) {
You can’t perform that action at this time.
0 commit comments