getPricingPlans cant show details

im trying to show the details of the current users plans and pricing but currently only the pln name is showing up here is my code i hope someone can help me.

import wixUsers from ‘wix-users’ ;
import wixLocation from ‘wix-location’ ;
import wixPaidPlans from ‘wix-paid-plans’ ;
import wixWindow from ‘wix-window’ ;

$w.onReady( function () {

// let user = wixUsers.currentUser.id;

// $w(‘#input’).value = user;
// $w(‘#input7’).value = user;
wixUsers.currentUser.getPricingPlans()
.then( (pricingPlans) => {
let firstPlan = pricingPlans[ 0 ];
let planName = firstPlan.name;
let qprice = firstPlan._id;
let benefits = firstPlan.benefits;
let sdate = firstPlan.startDate;
let eDate = firstPlan.expiryDate;
$w( ‘#input1’ ).value = planName;
$w( ‘#input2’ ).value = eDate;
});

Hi!

Looking at your code I can see that you have the values of two elements set to be the name of the plan and the expiration date of the plan. There is nothing setting the value of an element to be the plans price.

I noticed you did say that you are only seeing the plans name and not the price, are you not seeing the expiration date either?

If the issue is that you just cannot see the price, please add an element and set its value to be the plans price.

If you are unable to see the expiration date of the plan please send us a link to your site, and we will have a closer look.

The steps above are assuming you are trying to display this information on the page itself. If you would want to check the data for yourself you can just use console.log()

Hope this helps!

Dara | Corvid Team

hi thanks for the comment it really helps. i already fix this issue my concern now is that when i get the current users plan and he has 2 or more plans purchased the first plan he purchased was showing up and its already expired

my question is how can i show the most recently purchased plan or the active status plan.