In order to get cart information such as total cart price, items in the cart etc.. in a guest session in Sitecore CDP & Personalize, there is no cart object to use directly. Instead, ADD events in the session need to be aggregated until a CLEAR_CART event is reached. And note that for multiple ADD events with the same Product item id, only the first one is counted.

Below is the code example that can be used in Audience Filters or Decision Models to get the total cart price.

if (entity && guest && guest.sessions) {
    var currentWebSession = null;
    // Find current session 
    guest.sessions.forEach((session) => {
        if (session.sessionType === 'WEB' && session.ref == entity.sessionRef) {
            currentWebSession = session;
            return;
        }
    });
    if (currentWebSession !== null) {
        // Get cart price
        var cartPrice = 0;
        var itemIds = [];
        for (var i = 0; i < currentWebSession.events.length; i++) {
            var e = currentWebSession.events[i];
            if (e.type === "CLEAR_CART") {
                break;
            }
            if (e.type === "ADD" && e.arbitraryData && e.arbitraryData.product &&
                e.arbitraryData.product.item_id && e.arbitraryData.product.price && e.arbitraryData.product.quantity) {
                if (itemIds.indexOf(e.arbitraryData.product.item_id) == -1) { // Only the first ADD event of the same product item id is counted
                    cartPrice = cartPrice + (e.arbitraryData.product.price * e.arbitraryData.product.quantity);
                    itemIds.push(e.arbitraryData.product.item_id);
                }
            }
        }
    }
}
Note: entity is normally the object that have the trigger entity information such as when triggered by a custom event etc...