Hi @nalatine1 , you need to be more specific in your questions so we can help you.
Ahmad
Hi @nalatine1 , you need to be more specific in your questions so we can help you.
Ahmad
sure, no problem. Say I’m running this function:
import wixPaidPlans from ‘wix-paid-plans’;
import wixWindow from ‘wix-window’;
// Call getCurrentMemberOrders() when user clicks button
export function getOrdersButton_click(event) {
wixPaidPlans.getCurrentMemberOrders()
// Display orders in a table
.then ( orders => {
$w("#orderTable").rows = orders;
} )
.catch( (err) => {
console.log(err);
} );
}
Where/how do I see this response before posting to the table?
/* In this case, an orders array of two order items:
"id":"d3e95-...-6ec0",
"planId":"8050a0-...-ac9ab3",
"memberId":"4333a-...-0374ba",
"roleId":"8050a-...-c9ab3",
"orderType":"ONLINE",
"status":"ACTIVE",
"wixPayOrderId":"88265-...-e159",
"paymentStatus":"PAID",
"price":{
"amount":32,
"currency":"USD"
},
"planName":"Premium",
"planDescription":"Our most exclusive plan.",
"recurring":true,
"validFor": {
"forever":false,
"period": {
"amount":6,
"unit":"MONTH"
}
},
"validFrom":"2020-02-17T12:00:58.735Z",
"validUntil":"2020-08-17T12:00:58.735Z",
"dateCreated":"2020-02-17T12:00:58.735Z",
"cancellationInitiator":"UNDEFINED"
"id":"7861d30c--...-ad05de8",
"planId":"8050a0-...-ac9ab3",
"memberId":"4333a-...-0374ba",
"roleId":"8050a-...-47ac9ab3",
"orderType":"ONLINE",
"status":"ACTIVE",
"wixPayOrderId":"9215ac1-...-733c4668",
"paymentStatus":"PAID",
"price":{
"amount":32,
"currency":"USD"
},
"planName":"Basic",
"planDescription":"Our most basic plan",
"recurring":true,
"validFor": {
"forever":false,
"period": {
"amount":6,
"unit":"MONTH"
}
},
"validFrom":"2020-02-17T12:00:36.875Z",
"validUntil":"2020-08-17T12:00:36.875Z",
"dateCreated":"2020-02-17T12:00:36.875Z",
"cancellationInitiator":"UNDEFINED"
This was taken from example for wix-paid-plans > getCurrentMemberOrders()
You have syntax errors in your code, make sure to copy and paste it exactly as it is, and be careful when mutate it.
.then ( (orders) => {
console.log(orders);
$w("#orderTable").rows = orders;
}).catch( (err) => {
console.log(err);
} ); }
You’re missing the orange part, and the blue line will print it to the console for you to see.
Ahmad
Thank you! I appreciate quick responses. I did copy and paste exactly how it is in example below. I’ll go ahead and test edited code
Yes, they’re also missing them in their example, that’s why it’s not working.
Just replace the .then section with mine and it should work.
It worked. I can see logs in the console now!
Do you know how I can shorten the date in this table to just “Apr 03 2020”?
this is date is part of the repose of getCurrentMemberOrders function.
I’ve found the answer. Gotta make sure that column type set to date and then chose the date format in the Table settings.
Thank you Ahmad!
I was going to suggest doing so, too You’re welcome friend, glad that I helped.
Hi Sergil,
Can you explain the entire needful to complete this setup?