Hello Ahmad, the problem seems to be emanating from getting the results of both queries. I have tried with one query and everything seems to be working fine. but when I add the second query, it doesn’t work.
For the sample code that you sent, I changed to match my requirements:
import wixData from ‘wix-data’ ;
$w.onReady(() => {
Promise.all([
wixData.query( “Billing/Invoices” )
.find(),
wixData.query( “Stores/Orders” )
.find()
]).then((results) => {
const firstResult = results.length;
const secondResult = results.length;
if (firstResult> 0 ||secondResult> 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.”
}})})
Any other suggestions on where I might be doing it wrong?