Model/ResourceModel/Review.php
public function getProductCollection($quote)
    {
        $productIds = [];
        $products = [];
        $items = $quote->getAllVisibleItems();

        //get the product ids for the collection
        foreach ($items as $item) {
            $productIds[] = $item->getProductId();
        }

        if (! empty($productIds)) {
            $products = $this->productCollection->create()
                ->addAttributeToSelect('*')
                ->addFieldToFilter('entity_id', ['in' => $productIds]);
        }

        return $products;
    }
public function getProductCollection($quote)
    {
        $productIds = [];
        $products = [];
        $items = $quote->getAllVisibleItems();

        //get the product ids for the collection
        foreach ($items as $item) {
            $productIds[] = $item->getProductId();
        }

        if (! empty($productIds)) {
            $products = $this->productCollection->create()
                ->addAttributeToSelect('*')
                ->addFieldToFilter('entity_id', ['in' => $productIds]);
        }

        return $products;
    }
public function getProductCollection ( $ quote ) { $ productIds = [ ] ; $ products = [ ] ; $ items = $ quote -> getAllVisibleItems ( ) ; //get the product ids for the collection foreach ( $ items as $ item ) { $ productIds [ ] = $ item -> getProductId ( ) ; } if ( ! empty ( $ productIds ) ) { $ products = $ this -> productCollection -> create ( ) -> addAttributeToSelect ( '*' ) -> addFieldToFilter ( 'entity_id' , [ 'in' => $ productIds ] ) ; } return $ products ; }
Get product collection from order.

@param \Magento\Quote\Model\Quote $quote

@return array|\Magento\Framework\Data\Collection\AbstractDb
Get product collection from order .