enter image description here

I am Filter the Order Collection. Code give as

protected function searchResultToOutput(SearchResultInterface $searchResult)
    $arrItems = [];
    $arrItems['items'] = [];
    foreach ($searchResult->getItems() as $item) {
        $itemData = [];
        foreach ($item->getCustomAttributes() as $attribute) {
            $itemData[$attribute->getAttributeCode()] = $attribute->getValue();
        $arrItems['items'][] = $itemData;
        $arrItems['totalRecords'] = $searchResult->getTotalCount();

    //$sellerId = "25";
    $arr= array_filter($arrItems['items'], function($e) use ($currentUser) {
        return in_array($currentUser, explode(",", $e["current_seller_id"]));
    return $arrItems;

This code return the filtered array as i mention in snapshot But it not set on Grid. Actually this collection is filter for the sake of current_seller can see own orders. Data is not set in grid. Guid me why not data is set in Grid Even Collection .

  • Did you reindex your site? php bin/magento indexer:reset && php bin/magento indexer:reindex – CompactCode Feb 25 '19 at 15:27
  • wait i am running these commands – HaFiz Umer Feb 25 '19 at 15:28
  • same result. Just buffer the grid not data set in grid But in XHR i debug array return correctly But not set in grid. have any idea about it ? – HaFiz Umer Feb 25 '19 at 15:57
  • Do you have a module that extends products_listing.xml? – CompactCode Feb 25 '19 at 16:21
  • Also try to remove your ui_bookmark table records for product_listing. This will reset all your filters – CompactCode Feb 25 '19 at 16:23

Your Answer

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

Browse other questions tagged or ask your own question.