Get Commerce order by product and user
Problem:
I face an uncommon situation where I needed to get the order by the user who is the customer (or the person who ordered the item) and I also had the id of the product i purchased. Usually what happens is we need to find
- What oreders were done by the users
- What products (commerce_products) are in the order etc:-...
Solution:
I had 2 approaches