File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed
dev/tests/integration/testsuite/Magento/Weee/_files Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \Weee \Ui \Component \Listing ;
9
+
10
+ use Magento \Catalog \Ui \Component \Listing \Attribute \Repository ;
11
+ use Magento \Catalog \Ui \Component \Listing \Columns as DefaultColumns ;
12
+ use Magento \Weee \Model \Attribute \Backend \Weee \Tax ;
13
+
14
+ /**
15
+ * Class Columns
16
+ */
17
+ class Columns
18
+ {
19
+ /**
20
+ * @var Repository
21
+ */
22
+ private $ attributeRepository ;
23
+
24
+ /**
25
+ * @param Repository $attributeRepository
26
+ */
27
+ public function __construct (
28
+ Repository $ attributeRepository
29
+ ) {
30
+ $ this ->attributeRepository = $ attributeRepository ;
31
+ }
32
+
33
+ /**
34
+ * Makes column for FPT attribute in grid not sortable
35
+ *
36
+ * @param DefaultColumns $subject
37
+ */
38
+ public function afterPrepare (DefaultColumns $ subject ) : void
39
+ {
40
+ foreach ($ this ->attributeRepository ->getList () as $ attribute ) {
41
+ if ($ attribute ->getBackendModel () === Tax::class) {
42
+ $ column = $ subject ->getComponent ($ attribute ->getAttributeCode ());
43
+ $ columnConfig = $ column ->getData ('config ' );
44
+ $ columnConfig ['sortable ' ] = false ;
45
+ $ column ->setData ('config ' , $ columnConfig );
46
+ }
47
+ }
48
+ }
49
+ }
Original file line number Diff line number Diff line change 84
84
<type name =" Magento\Catalog\Model\ResourceModel\Attribute\RemoveProductAttributeData" >
85
85
<plugin name =" removeWeeAttributesData" type =" Magento\Weee\Plugin\Catalog\ResourceModel\Attribute\RemoveProductWeeData" />
86
86
</type >
87
+ <type name =" Magento\Catalog\Ui\Component\Listing\Columns" >
88
+ <plugin name =" changeWeeColumnConfig" type =" Magento\Weee\Ui\Component\Listing\Columns" />
89
+ </type >
87
90
</config >
Original file line number Diff line number Diff line change 6
6
7
7
declare (strict_types=1 );
8
8
9
+ use Magento \TestFramework \Workaround \Override \Fixture \Resolver ;
10
+ Resolver::getInstance ()->requireDataFixture ('Magento/Weee/_files/fixed_product_attribute_rollback.php ' );
11
+
9
12
$ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
10
13
11
14
/** @var \Magento\Eav\Model\Entity\Attribute\Set $attributeSet */
27
30
'attribute_group_id ' => $ attributeGroupId ,
28
31
'frontend_input ' => 'weee ' ,
29
32
'frontend_label ' => 'fixed product tax ' ,
33
+ 'is_used_in_grid ' => '1 ' ,
30
34
];
31
35
32
36
/** @var \Magento\Catalog\Model\Entity\Attribute $attribute */
You can’t perform that action at this time.
0 commit comments