minimum order amount by code

Hi friends.
Tried to check subtotal in the cart using the code as in the picture


in backend and then get the value on the side of the site, but in the end nothing comes out… May be anyone else encountered this problem or maybe have some ideas.The API has never found any function that can show subtotal

Hi,
this is what I did:

This is the code in the backend:

export function getTotal() {
 let cart = wixStoresBackend.getCurrentCart();
 return cart;
}

This is the code at the cart page:

getTotal().then(function(product) {
 let total = product.totals.total;
 if (total<250) {
            wixWindow.openLightbox("minOrder")
        }
});

it’s open a lightbox saying that order must be above 250.
it’s the best I could think of.