I need to override the get orders list API call, and set a join with my custom table, but without loose the SearchCriteria terms, is this possible?

Current Code: (I've created a plugin in Magento\Sales\Api\OrderRepositoryInterface inside webapi_rest folder.)

public function aroundGetList
    \Magento\Sales\Api\OrderRepositoryInterface $subject,
    callable $proceed,
    \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
    $searchResult = $this->searchResultFactory->create();
    $this->collectionProcessor->process($searchCriteria, $searchResult);
    foreach ($searchResult->getItems() as $order) {
    return $searchResult;


I solve this situation as following:

        'main_table.entity_id = myAlias.id',
  • their is no getSelect() method in SearchResult
    – Hiren
    Mar 19 '19 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.