I am trying to hide and show buttons on a page based on the name of a users paid plan.
So far I have this code to get the plan name. Can anyone help further?
Many thanks
Sian
import wixUsers from ‘wix-users’ ; let user = wixUsers . currentUser ;
$w . onReady (()=> {
user . getPricingPlans (). then (( plans ) => { if ( plans . length > 0 ) { let $w ( “textPlanTitle” ). plans . Name
$w ( “#text35” ). hide ();
$w ( ‘#buynowButton’ ). hide ();
// The member has paid plan purchased
// Handle the case here by showing and
// hiding elements
} else {
// handle the case where user doesn’t have
// pricing plan
}
})
})
I’m building a marketplace that displays profiles of members. Each member needs to first purchase a paid plan in order to create their profile. On the Marketplace page, I have a repeater that displays all the member profiles.
MY QUESTION:
Is it possible to check the status of a member’s plan and hide member profiles if status is PAUSED or CANCELED — basically if the plan is not ACTIVE?
Yes, everything is possible! If Wix has provided APIs for your wished element/scenario/functionality → then there also is a way to generate what you want/need.
Take a look onto the following example…
If your wished functionality will work or not, depends on…
Check the API and get your conclusion.
API given for → pause a plan? → I think yes, because i have seen already!
API for cancel an plan-order? → you see the example.
API for make a plan-order-list? → you see the example.
API for marking orders as paid → was also in example (just not mentioned), but possible.