Can we make design visible if the database have value?

So I'm making an add cart system where user can add items they select, I'm using tinydb as my database but I encounter a problem using it, when I'm adding a cart it only saving one items then overwritten the previous save if I add items again. So I'm planning to use a method where I would save the data in different namespace, then if that namespace have save value it would make that particular design visible then if it don't have value store it would not display that design. I don't know if this possible any advice?

Or you can get the value stored, modify it (add/remove/modify items), and store it again.

Can you help me here?

Here's my block I'm using.
Here's the blocks when I'm adding cart.

Here when I'm displaying the items in different screen.

Before to store the new Cart, Get the value of "Cart" Tag, add the item to the list, and store the list into "Cart" Tag.

Something like this (it's only an example):

I suppose your Pictures are in your assets?

Yes my picture was on my assets. That block you provide when I use this would me allow to save multiple data in one tag or namespace in tinydb?

What those blocks do is, like you can see, get the list stored under the tag "Cart", add a new item into the list recovered, and then it stored the new list (the list with the additional element) into the same Tag "Cart" overwriting it, but now the new list has all the stored elements plus the new one so, you don't lose items.

Did I do something wrong? When I try this this what happen

It did not display the image instead it just a list.

You are storing a list of two elements for each item stored in Cart.

So, when displaying it, you need to select the item of the Cart, and then, for that item, select element 1 (Picture) and element 2 (name).

Is this correct?

Add Cart

Displaying

Result:

It still not displaying properly

You have now a list of lists. That means that you have a list of items (Carts) where each one is a list of two elements: Picture and name so, for each item (cart) you have to select the first one for the Picture and the second one for the name. Here an example to show you how it must work:

As you can see you select one item (cart)

and then, for that item, you select the first element for the picture and the second one for the text.

It works thank you.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.