Positive added / Negative removed
([1] => 3 [6] => -2 )
Next the customer can change all the settings of the snack contains a standard amount (recipe)
it can remove 2x and can add lettuce 1x 2x 3x
In case he added 3x and withdrew 2x
Then the system has to do a substitution 1 steak for 1 lettuce and an additional 1 lettuce , then the system has to have extra / withdrawal / replacement ... in my view it will always happen or replace and add or replace and remove /// or just subistitui
remembering that everything dynamic can happen this possibilities several times
-+ Bacon por Alfance = R1,00
+ Alfance = R$ 0,50
-+ 2x Bacon por Alfance = R2,00
+ Alfance = R$ 0,50
Here's a demo link of how the client would do what he can do ...
Those that have already been marked and the standard recipe for the product ... that can also be changed ...
I could do it to
**o problema esta aki como interpretar esse array**
(
[1] => 3 // [id_produto] => quantidade
[6] => -2 // [id_produto] => quantidade
)
fazer-lo virar
-+ 2x Bacon por Alfance = R2,00
+ Alfance = R$ 0,50
**as os possivel acontecimentos para esse array**
-+ 2x Bacon por Alfance = R2,00
+ Alfance = R$ 0,50
-+ Bacon por Alfance = R1,00
- Alfance = R$ 0,50
-+ 2x Bacon por Alfance = R1,00
link I put the system online