Hi, guys!
I’m making a Virtual Shopping system and getting trouble with subtracting item’s quantity after a purchase is confirmed.
I tried even javascript withToolbox plugin, without success. 
My database:
Product (with name, info, amount, etc) 
Cart (list of Products, amount purchased + other things) 
 
When I try to subtract, I get this:
P.s.:
“Produto” == Product 
“Carrinho” == Cart 
“Quantidade” == Amount 
 
Thanks in advance!!
             
            
              
            
           
          
            
            
              Hello!
Make sure that your quantidade and estoque are numbers. The expression is red possibly because one of them may not be.
             
            
              
            
           
          
            
            
              Hi, @cmarchan !
They are!  “Quantidade” is a list of numbers that represents the amount of  each “Produtcs” included.
And if I try to get the “:item #”, I fail too.
             
            
              
            
           
          
            
            
              What does the issue checker say? It’s probably to do with either a mismatch in datatype/field type, or mixing up single items with lists. The issue checker will tell you what the issue is.
             
            
              1 Like 
            
            
           
          
            
            
              Hi, @adamhholmes !
If I let the way I posted first, the issue checker returns this:
If I use “:first item” or “:sum”,  the result is wrong. Cause of this, I tried to use “:item #”. But without success too.
             
            
              
            
           
          
          
            
              
                system  
              
                  
                    May 2, 2021, 10:28pm
                   
                  7 
               
             
            
              This topic was automatically closed after 70 days. New replies are no longer allowed.