Hello and thank you for helping in advance.
I know virtually nothing about coding but copied something I found on this forum earlier in order to basically show one button for users with an active pricing plan and one thing for everything else.
Unless I am delusional, this worked at one point in time. Nothing - as far as I am aware, has changed since today and two days ago on the site which should have caused this. I removed some community pages since we did not use them as well as some other pages, however, I don’t see how this would be relevant. Below is the code in question:
import wixUsers from ‘wix-users’ ;
let user = wixUsers . currentUser ;
$w . onReady (()=> {
user . getPricingPlans (). then (( plans ) => {
if ( plans . length > 0 ) {
let firstPlan = plans [ 0 ];
let today = new Date ();
**if** ( today . getTime () >= firstPlan . expiryDate . getTime ()) {
$w ( '#button49' ). show ();
$w ( '#button37' ). hide ();
} **else** {
$w ( '#button49' ). hide ();
$w ( '#button37' ). show ();
}
} **else** {
$w ( '#button49' ). show ();
$w ( '#button37' ). hide ();
}
})
})
Is the code broken and was I simply mistaken earlier? Could something else have caused this?