Abonemment Show and Hide Elements

How Can I code something that checks if the user has a paid abonnement (in this case I got 3 different)
and show or hide elements for each Abonemment. Ive tried so much but nothing works for me. Even with roles and all that.
HOPING FOR HELP

Hi!

Try ot:

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';

$w.onReady(() => {
    if (wixUsers.currentUser.loggedIn) {
        wixUsers.currentUser.subscriptions()
            .then((subscriptions) => {
                let hasSubscription = false;
                for (let i = 0; i < subscriptions.length; i++) {
                    if (subscriptions[i].planId === "premium_plan") {
                        hasSubscription = true;
                        break;
                    }
                }
                if (!hasSubscription) {
                    $w("#myElement").hide();
                } else {
                    $w("#myElement").show();
                }
            });
    } else {
        wixLocation.to("/login");
    }
});