Skip to content

Commit

Permalink
- Removed the limitation of when there is only one result after a rul…
Browse files Browse the repository at this point in the history
…e has been processed it would immediately return that result instead of looking further. Now it will process all rules that are applicable and return a result as filtered after running through all of them (based on certain conditions for the rules), if the result turns out to be empty, it will return an empty array still
  • Loading branch information
24198 committed Aug 15, 2020
1 parent e83245d commit c0f33b1
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,9 @@ public function getWarehousesForOrder(Order $order)
$strategy = $this->strategiesRegistry->getStrategy($rule->getStrategy());
$strategy->setEstimation($this->estimation);
$results = $strategy->getWarehouseResults($order, $results);

if (count($results) === 1) {
return reset($results);
}
}

if (count($results) >= 1) {
if (count($results) >= 0) {
return reset($results);
}

Expand Down

0 comments on commit c0f33b1

Please sign in to comment.