Dabbling around with Data Store (maginificent addition to Wappler), I noticed that lastid is very persistent, in that it does not return to 1 when the Data Store has been been deleted.
I feel that there is an underlying reason that I cannot fathom at this stage. Please enlighten me.
I managed to get this one to return to 1 (or should it be 0) by deleting by hand.
How did you delete the Data Store? It should reset the lastid when you use the clear method. When using the delete method it does not update the lastid. The lastid is used to generate the $id and can only be reset by clearing the Data Store.
That is exactly what it should do, when cleared it is just an empty collection. You don’t require the lastid, it is used internally for the $id generation. You should check if the result is empty with the hasItems formatter. Disable the Checkout button with dmx-bind:disabled="!dsCart.data.hasItems()" and perhaps show a bootstrap alert in the dialog that the cart is empty and the user should add something first.