I have a product page I am designing and need a little help with the code. I am trying to display a custom related items Repeater by displaying ByCollections. I’ve run into a couple of problems that I can’t seem to figure out! (See below the code for what the error says)
getProduct – property does not exist on type ‘Page’
RelatedProductResults – ’ , ’ expected
Thank you in advance for taking a look!
The opening curly brace in the end of line 12 is not needed.
Is this the default Wix Stores product page or custom dynamic page?
thanks for responding, It’s the default product page
import wixStores from ‘wix-stores’ ;
Have you tried adding this to the beginning of your code?
async function loadRelatedProducts ( ) {
let product = await $w ( ‘#ProductPage’ ). getProduct ();
let RelatedProductResults = await relatedProductsByCollection ( product )
showRelatedProducts ( RelatedProductResults );
}