each item template
is its own form.
notice how in the init
method you are setting self.data = []
this is true for each item template
of which you have 3
So you need to keep track of the data
in the cart a different way.
each item template
appends the item
to its own self.data
attribute (so when you click a new item template you are appending it to a different list…
Here’s one way you could do it.
https://anvil.works/build#clone:SBJ326OO3HGI3RHI=ZCVATU3UCPQTW4JZQTONSU7C