@ahmadnasriya Hi! This code was working properly but for some reason it is not working anymore.
Here is what the current code looks like:
$w.onReady(()=> {
let user = wixUsers.currentUser;
user.getPricingPlans().then(plans => {
const time = new Date().getTime();
// Get only the active plans;
plans.filter(items => items.expiryDate.getTime() < time);
// Get the plan that matches the specified name
plans.filter(items => items.name === 'planname');
/* Now check if there are any items in the plans array, if there are
any items left, then the plan is found and is active */
if (plans.length > 0) {
// The user has an active plan;
$w("#button1").show();
} else {
// User doesn't have an active plan
$w("#errrortxt").show();
}
})
})
Here is what console error says:
Do you have any idea what is wrong here? Like i said, it has been working for year or so.

