Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. $collection = $this->_productCollectionFactory->create();
  2. $collection->addAttributeToSelect('*');
  3.  
  4. $categoryData = $this->getRequest()->getParam('whoisitfor');
  5.  
  6. // Get category selected.
  7. if(isset($categoryData)) {
  8. $categoryData = $this->expandFormValues($categoryData);
  9. $categories = [$categoryData];//category ids array
  10. $collection->addCategoriesFilter(['in' => $categories]);
  11. }
  12.  
  13. $collection->addAttributeToFilter('user_experience_level', array('eq' => 3003));
  14.  
  15. $collection = $this->_productCollectionFactory->create();
  16. $collection->addAttributeToSelect('*');
  17.  
  18. $categoryData = $this->getRequest()->getParam('whoisitfor');
  19.  
  20. // Get category selected.
  21. if(isset($categoryData)) {
  22. $categoryData = $this->expandFormValues($categoryData);
  23. $categories = [$categoryData];//category ids array
  24. $collection->addCategoriesFilter(['in' => $categories]);
  25. }
  26.  
  27. $collection->addAttributeToFilter('user_experience_level', array('eq' => 3003));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement