File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
app/code/Magento/SalesRule/Model/Plugin Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class QuoteConfigProductAttributes
22
22
/**
23
23
* @var array|null
24
24
*/
25
- private $ activeAttributes ;
25
+ private $ activeAttributeCodes ;
26
26
27
27
/**
28
28
* @param RuleResource $ruleResource
@@ -43,24 +43,18 @@ public function __construct(RuleResource $ruleResource)
43
43
*/
44
44
public function afterGetProductAttributes (Config $ subject , array $ attributeKeys ): array
45
45
{
46
- $ attributes = $ this ->getActiveAttributes ();
47
-
48
- foreach ($ attributes as $ attribute ) {
49
- $ attributeKeys [] = $ attribute ['attribute_code ' ];
50
- }
51
-
52
- return $ attributeKeys ;
46
+ return array_merge ($ attributeKeys , $ this ->getActiveAttributeCodes ());
53
47
}
54
48
55
49
/**
56
50
* @return array
57
51
*/
58
- private function getActiveAttributes (): array
52
+ private function getActiveAttributeCodes (): array
59
53
{
60
- if ($ this ->activeAttributes === null ) {
61
- $ this ->activeAttributes = $ this ->ruleResource ->getActiveAttributes ();
54
+ if ($ this ->activeAttributeCodes === null ) {
55
+ $ this ->activeAttributeCodes = array_column ( $ this ->ruleResource ->getActiveAttributes (), ' attribute_code ' );
62
56
}
63
57
64
- return $ this ->activeAttributes ;
58
+ return $ this ->activeAttributeCodes ;
65
59
}
66
60
}
You can’t perform that action at this time.
0 commit comments