diff --git a/Plugin/Model/Order/LoadOrderComment.php b/Plugin/Model/Order/LoadOrderComment.php index 8d14202..e4903d5 100644 --- a/Plugin/Model/Order/LoadOrderComment.php +++ b/Plugin/Model/Order/LoadOrderComment.php @@ -27,6 +27,16 @@ public function afterGet( return $resultOrder; } + public function afterGetList( + OrderRepositoryInterface $subject, + \Magento\Sales\Api\Data\OrderSearchResultInterface $orderSearchResult + ) { + foreach ($orderSearchResult->getItems() as $order) { + $this->setOrderComment($order); + } + return $orderSearchResult; + } + public function setOrderComment(OrderInterface $order) { if ($order instanceof \Magento\Sales\Model\Order) {