Skip to content

Commit 479130d

Browse files
authored
[FEATURE] Performance optimisation large shopping carts by preventing call duplicate getActions
1 parent 5a2037c commit 479130d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/code/Magento/SalesRule/Model/Validator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,9 @@ public function sortItemsByPriority($items, Address $address = null)
745745
$itemsSorted = [];
746746
/** @var $rule Rule */
747747
foreach ($this->getRules($address) as $rule) {
748+
$actions = $rule->getActions();
748749
foreach ($items as $itemKey => $itemValue) {
749-
if ($rule->getActions()->validate($itemValue)) {
750+
if ($actions->validate($itemValue)) {
750751
unset($items[$itemKey]);
751752
$itemsSorted[] = $itemValue;
752753
}

0 commit comments

Comments
 (0)