Is it really not possible to query or even get the collections for each product?
Using getProduct() on the product page returns "undefined" for all products (on all Wix Stores on all websites. I have tested 5.)
![](https://static.wixstatic.com/media/a27d24_34527439cfb34162b9548a1c0f612082~mv2.png/v1/fill/w_980,h_454,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_34527439cfb34162b9548a1c0f612082~mv2.png)
Collections is not listed as a member in the reference docs even though it appears in the console.
![](https://static.wixstatic.com/media/a27d24_13ef4097f3094425916f8a7e2c7032a5~mv2.png/v1/fill/w_980,h_534,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_13ef4097f3094425916f8a7e2c7032a5~mv2.png)
Even when attempting to query the Stores/Products collection, "undefined" is returned for all products each time.
![](https://static.wixstatic.com/media/a27d24_1d73d6c17cbb4066afcf1185d6fe3587~mv2.png/v1/fill/w_980,h_571,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_1d73d6c17cbb4066afcf1185d6fe3587~mv2.png)
Is there absolutely no way to pull this information at all? Why? How?
Hi
I'm Oded from Wix.
So right now, there 2 ways you can do this
You can use query + include - if you need this for multiple products
wixData.query("Stores/Products").include("collections").find().then(x => { console.log(x.items[0].collections); });
You can query referenced - if you need this for a single product
wixData.queryReferenced("Stores/Products", "f2c944b4-9766-913c-e0e2-41a6e0136989", "collections").then(x => { console.log(x.items); });
$w("#productPage).getProduct does not support returning the collections at all as you saw in the documentation. I agree that the fact that we return undefined (both here and when include is missing) is confusing.
I can also imagine another parameter sent to $w("#productPage).getProduct which will allow you to ask for collections, but I wouldn't say it has a huge value since you can use query referenced.
Thanks for your feedback!
You definitely can pull it. I haven't used getProduct(), but querying the Stores/Products ( with its custom limit on 100 items) database directly does give both the products and the collection IDs, which you can cross reference against the Stores/Collections Database. I'm guessing you tried that already?
Collections is reference field, you need to include it in your request