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