Reference productPage from HomePage

I am new to corvid and JavaScript, but have been a C++ and Pascal developer for years.

I wanted to show on our home page how many items we have in stock (I have only one product)
I was able to get it working on the product page
$w( ‘#productPage1’ ).getProduct()
But $w( ’ #productPage1 ’ ) can not be referenced from the home page
how do I do something like:
$w( ’ #home.productPage1 ’ )

The line here ’ $w( ’ #productPage1 ’ ).getProduct()’ is calling the productPage1 element that is on the page itself.

If you want to query Wix Stores collections from other pages, then look at using the collections as shown here.
https://support.wix.com/en/corvid-by-wix/wix-stores-with-corvid

Wix Stores API can be read about here.
https://www.wix.com/corvid/reference/wix-stores.html
https://www.wix.com/corvid/reference/wix-stores-backend.html
https://www.wix.com/corvid/reference/$w.ProductPage.html
https://www.wix.com/corvid/reference/$w.CartIcon.html