I did as you instructed, and it works great. I already had the column "stockAmount" in my eCart Object, as it is used for inventory control/reduction upon sucessful checkout.
I added the calculation as follows:
and I named it "addToCartCheck".
All works great, except I have one small issue: All of my products are in a repeating list on the page. If the add to cart fails and my error message shows, my error message shows for all products in the repeat, not just for the one product. The error message is caught inside the repeat region.
Is there a way to correct it to show only next to the product that was added? Thanks.
See screenshot for example. Attached is code.