Hello everyone,
I made ratings and reviews by this tutorial: https://support.wix.com/en/article/corvid-tutorial-adding-ratings-and-reviews-to-a-wix-stores-site, but I get an error in code when I go to the preview page.
TypeError: $w(...).getProduct is not a function
My code
$w.onReady(async function () {
// Set the global product variable to the currently displayed product.
product = await $w('#productPage1').getProduct();
// Load the current product's reviews using the initReviews() function.
initReviews();
});
What could be the problem?
I am getting this same error: $w(...).getProduct is not a function
Is there any fix to try myself? Having a hard time contacting Wix support, assuming they are overwhelmed with all the COVID-19 craziness.
I'm trying to access the product details from the corresponding Product Page so I can check if the product is in stock. I want to dynamically show an email collection form when the product is out of stock.
Yes, code error was fixed, but reviews still do not working.
The issue was fixed and the error should no longer appear.
Please contact Wix support if it occurs again.
I am also facing the same problem. https://www.wix.com/corvid/forum/community-discussion/getproduct-is-not-a-function/p-1/dl-5e53d1637c917300172be09e
I apologize for the confusion. We are aware of this issue and have forwarded your information to the relevant department.
Could you please send us your site and Editor link for further investigation?
Hi! Please make sure that the element IDs in your code match the ones on your page. In addition, are you inserting this code to a default product page? Or do you have custom dynamic pages to display products?