Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. $bestsalecollection = $this->_collectionFactory->create()->setModel(
  2. MagentoCatalogModelProduct::class
  3. )->addStoreFilter(
  4. $storeId
  5. );
  6. $productCollection = $this->productcollectionFactory->create();
  7. $sellercollection=$productCollection->addFieldToFilter('current_user_id',array('eq'=>1));
  8. $filter_product=[];
  9.  
  10. foreach ($sellercollection as $allProduct){
  11. foreach ($bestsalecollection as $bestSale){
  12. if($allProduct->getEntityId()==$bestSale->getProductId()){
  13. $filter_product[]=$bestSale;
  14. }
  15. }
  16. }
  17. $this->_logger->info(print_r($bestSale->getData(),true)); $this->setCollection($filter_product);
  18. return parent::_prepareCollection();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement