Thank you for your response on the hunt! I have removed the async and populated results as result.items.length. When I quey once collection only, everything works. The issue must be querying the two collections simultaneously. There are no errors on the console.log preview but the code doesn’t work on the live editor.
import wixData from ‘wix-data’ ;
$w.onReady( function () {
wixData.query( “Billing/Invoices” )
.eq( “status” , “Paid” )
.find()
.then( (result) =>{
let res=result.items.length
wixData.query( “Stores/Orders” )
.find()
.then( (results) => {
let orders= results.items.length
if (res> 0 ||orders> 0 ){
$w( ‘#group1’ ).show()
$w( “#text10” ).hide()
$w( “#button1” ).hide()
} else {
$w( ‘#group1’ ).hide()
$w( “#text10” ).show()
$w( “#button1” ).show()
$w( “#text10” ).text= “To access this page, please purchase a package.” ;
}
} );
})
})
Have a look again. Regards!