Hello everyone !
I have a little question, I cannot find how to get the custom text fields values on orderpaid event.
That’s my code:
import wixData from 'wix-data';
export function wixStores_onOrderPaid(event) {
for (let i = 0; i < event.lineItems.length; i++) {
let toInsert = {"details": `${event.lineItems[i].name} ${event.lineItems[i].quantity} ${event.lineItems[i].customTextFields}`};
wixData.insert("API_Boutique", toInsert)
}
}
The code is working except the customtextfields expression, I tried a lot of syntax like “${event.lineItems[i].customTextFields.value}” or “${event.lineItems[i].customTextFields[1].value}”, …
But that just give me an undefined value or default object value:
The name section is working, the quantity expression too. But not the customTextFields value.
The event tutorial: https://www.wix.com/velo/reference/wix-stores-backend/events/onorderpaid
I just want to know how can I get the values of this section. Thanks !