Paid Plan Orders - Loop with break

try something like this instead of using a for loop to find something use the .find() and then you can look at whats inside the result and set the text with that. I haven’t tested as i don’t use wix paid plans but it should work fine


const planName = "TEST";
$w.onReady(function () {
    console.log(findOrders());
});

function findOrders(){
 var result = wixPaidPlans.getCurrentMemberOrders().find((order => order.planName === planName && order.status === "Active" ));
 return result;
}