getProduct is not a function error

Im having trouble setting up the getProduct() function.

My code is very simple:

$w.onReady(async function () {
let product = await $w('#productPage1').getProduct();
});

and I’m getting the following error on the logs:

TypeError: $w('#productPage1').getProduct is not a function. (In '$w('#productPage1').getProduct()', '$w('#productPage1').getProduct' is undefined)

Any ideas? My Product Page ID is definitely ‘#productPage1’.

You can open the ticket in Wix Support about this issue as it would be easier to take a deeper look at this issue on your site and in the Editor:
https://support.wix.com/en/article/contacting-wix-support

Please also specify in your ticket which site and page should we look at!

Wix Stores & Wix Users APIs are not fully functional on Preview Mode , publish your changes and it’ll work.

It’s not an issue, it’s just an API limitation.