Calculating total value of invoice

I’m trying to calculate a grand total of some figures in a repeating group. I’ve got two repeating groups on my page. The top one is where you choose products which are then listed in the RG below where the user can change the quantity. It then calculates the Price * Quanity to give the Total on each row. That works fine. Here’s a screen shot of it…

What I want to do though is have a “Grand Total” where there’s a ‘0’ in the screen shot but that’s where I’m having trouble. I’ve done loads of searching and can only conclude that it’s actually really tricky involving Custom States and lots of “jiggery pokery” but surely it’s a pretty basic requirement so I’m wondering if I’ve missed something.
Could someone point me in the right direction? I promise I’ve spent ages looking for an answer and got nowhere so any help is much appreciated.
All the best

We have a similar kind of system on our website, essentially we did it into data.

I’ve made you a bit of a similar example here:

To get it to work in run mode you’ll have to run the system as the user that I’ve made, if you have any issues let me know and I can send you a video.

Just toying with the “quantity” aspect of it.

1 Like

That’s extremely kind and looks like what I need. I don’t understand how to get it work in “run mode” (sorry, still quite new to Bubble) as a different user. I’m eager to see how you got this to work. Thank you.

Sure, so the link I sent you is the backend. I’ll record a quick video now for you :slight_smile:

@joefarrowsmith You’ll have to excuse the mathematic bugs and all that kinda jazz threw this together pretty quick. Hopefully this gives you a relatively OK understanding of how you could get a cart to work etc.

That’s awesome. Thank you so much -it’s exactly what I want to be able to do. Can I ask how you created your “Total” result at the bottom?

Sure, so if you look on the backend. Essentially the cart has a “Total” and when a new item is added to the cart I just do

Current User’s Cart Total + Current Cell’s Product’s Price

which updates total

Be aware that it will get quite complex when it comes to updating prices and quantities etc but it’s a good base. If you feel I’ve helped please mark my original comment as the solution :slight_smile:

Many thanks. I’m giving it a go right now. This is very helpful and I really appreciate your time and trouble.

All the best

1 Like