Using the get order function from the thank you page https://www.wix.com/corvid/reference/$w.ThankYouPage.html#getOrder I managed to get the order details into another database. but the line items of the order are in an array like below.
[
{
"weight": 1.42,
"name": "A great product",
"quantity": 1,
"sku": "sku",
"lineItemType": "",
"tax": 5,
"price": 5,
"translatedName": "a",
"taxGroupId": "4",
"totalPrice": 6,
"priceData": {
"totalPrice": 6,
"price": 5,
"taxIncludedInPrice": false
},
"options": [
{
"selection": "value",
"option": "title"
}
],
"customTextFields": [
{
"value": "value",
"title": "title"
}
],
"productId": "",
"notes": "some notes",
"mediaItem": {
"altText": "a",
"externalImageUrl": "http://static.wixstatic.com/media/289e7e_4d7e6ed33f324a0aa3e1821ee6142781~mv2.jpeg/v1/fill/w_50,h_50,al_c,q_90/file.jpg",
"src": "wix:image://v1/289e7e_4d7e6ed33f324a0aa3e1821ee6142781~mv2.jpeg/file.jpg#originWidth=50&originHeight=50",
"mediaId": "1",
"type": "image"
},
"discount": 5,
"index": 1
}
]
Was wondering how to split the array to get all the information into separate items in a database? And corresponding to the order id also.