PIM-3067: Export products only for defined tree

| Q                    | A
| -------------------- | ---
| Bug fix?             | Y
| New feature?         | N
| BC breaks?           | Y - Needs to calculate treeIds for each product
| CI currently passes? | N
| Tests pass?          | Y
| Scenarios pass?      | MongoDB 166
| Checkstyle issues?*  | N
| PMD issues?**        | N
| Changelog updated?   | Y
| Fixed tickets        | PIM-3067
| Doc PR               |
`array_search` can return false
should be splited into 2 statements