Wix Stores order details

Is there perhaps a way to extract the buyer Info and line items per order from the Orders database?

Because I cant connect them to an element?

Hey!

You can get only the information mentioned in the article:

Pay extra attention to the section Buyer Info (buyerInfo)

Thanks @yevheniias . I have since came right with the buyer info :slight_smile: still struggling with the Order line items.


Below is my code which is on a dynamic page, I can get my repeater to display static data but not dynamic data:

/*******************************
 * backend code - orders.jsw *
 *******************************/

import wixData from 'wix-data';
import wixStoresBackend from 'wix-stores-backend';
// Supressing db authorizations allows very secure (limited) database permissions.
const options = {
 "suppressAuth": true
};

export async function getorders() {
 let results = await wixData.query("Stores/Orders");

}


/*********************************
 * client-side*
 *********************************/

import {getorders} from 'backend/orders';



$w.onReady(function () {    
 let currentItem = $w("#dynamicDataset").getCurrentItem();
 let orderitems =  [{

 "index": String(currentItem.lineItem.index),
 "quantity": currentItem.lineItems.quantity,
 "price": currentItem.lineItems.price,
 "name": String(currentItem.lineItems.name),
 "productId": currentItem.lineItems.productId,
 "totalPrice": currentItem.lineItems.totalPrice,
 "sku": currentItem.lineItems.sku,

/*  

    "_id": String("1"),
    "index": 1,
    "quantity": 1,
    "price": 10,
    "name": "I'm a product",
    "translatedName": "I'm a product",
    "productId": "c8539b66-7a44-fe18-affc-afec4be8562a",
    "totalPrice": 10,
    "lineItemType": "PHYSICAL",

*/
    }]

$w('#orderumber').text = "Order #" + String(Number(currentItem.number));


$w("#repeater1").data = orderitems
$w("#repeater1").onItemReady( ($item, itemData, index) => {

$w("#itemname").text = String(itemData.name);
 
})

});

Did you find the way? @sheld8n Im looking to do the same with the shopping cart, i want to get the info of the products in the cart. (Name, price and total price)