Well – I just a little bit get out of ideas or my .
I receive via webhook order data. For some statistical needs I want to parse those data.
As You can see I have array Products with some collections.
- each collection is separate product that was bought by customer.
- each collection can contain product of the same “name” parameter
Now I want to set variable where I get
- sum price_brutto of each collection with the same name parameter
- total sum of collection where name is the same
In uploaded case I want to get
Odbitki_sum = 15.2+13.3
Odbitki_total = 2
I created array with each unique name (that one work flawless)
Now I want to use Iterator of this array to iterate through all products. I started with this and wanted to use some if logic but it just doesn’t work.
Ah! One thing – of course I can iterate through each collection separately but in some cases we get orders with 500+ elements and it could be expensive, so I want to with “tricky way”.