There is an array of goods in the basket.
If you output an array, you get this
Array ( [02db2e33f6361f61182f0226bff9796b] => Array ( [rowid] => 02db2e33f6361f61182f0226bff9796b [id] => 349 [qty] => 1 [price] => 14000 [name] => Dailies Total 1 [images] => e0cf9568ddbf6c809e4f79d13fdedadc.jpg [discount] => 0 [options] => Array ( [optical] => -01.00 [radius] => 8.5 [optical_power] => [os_grad] => [color] => ) [subtotal] => 14000 ) [0ac30b646b9d132a26080046573a91ee] => Array ( [rowid] => 0ac30b646b9d132a26080046573a91ee [id] => 349 [qty] => 1 [price] => 14000 [name] => Dailies Total 1 [images] => e0cf9568ddbf6c809e4f79d13fdedadc.jpg [discount] => 0 [options] => Array ( [optical] => -01.25 [radius] => 8.5 [optical_power] => [os_grad] => [color] => ) [subtotal] => 14000 ) [1482d85f3864ac22acea2a7b326d72a5] => Array ( [rowid] => 1482d85f3864ac22acea2a7b326d72a5 [id] => 13 [qty] => 1 [price] => 4580 [name] => ACUVUE 2 6шт. [images] => 00fe0b832ea22485b52523b853503682.jpeg [discount] => 0 [options] => Array ( [optical] => -00.50 [radius] => 8.3 [optical_power] => [os_grad] => [color] => ) [subtotal] => 4580 ) ) There are three products. The two items have the same id field. I need to iterate over the entire array and if the same id then assign the field discount = 5.
How to do?