I have a collection which contains the product page URL against each product. Now I am using the following code:
wixData .query( “ProductsModified” )
.eq( “collections” , keyvalue)
.ascending( “sortingValue” )
.find()
.then( (results) => {
if (results. items. length > 0 ) {
itemresult = results. items[ 0 ];
$w( ‘#text102’ ). text = itemresult. name;
$w( ‘#text102’ ). onClick((event) => {
wixLocation. to(itemresult. productPageUrl)});
$w( ‘#text110’ ). text = itemresult. formattedPrice;
$w( ‘#text111’ ). text = itemresult. formattedDiscountedPrice;
$w( ‘#image71’ ). src = itemresult. mainMedia;
However, the wixLocation. to statement is not working.
itemresult.productPageUrl returns the correct URL.
Can anyone help?