I hope this sort of makes sense.
I have the above warnings showing in my server error logs.[28-Apr-2021 06:36:28 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/####/public_html/includes/system/override/shopping_cart.php on line 154
[28-Apr-2021 06:36:28 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/####/public_html/includes/system/override/shopping_cart.php on line 172
The file in question is a copy of the shopping cart file from the 1.0.7.3 folder in versioned but with some added code, which has been added to the override folder so the items in the shopping cart are sorted into model number. This was code given by Gary in the older forum and works as expected.
Here is the code that was added
Code: Select all
array_multisort(array_map(function($e) { return $e['model']; }, $products), SORT_ASC, $products);
}
Code: Select all
return $products;
The sort order is working as expected and apart from those two warnings everything else is working fine.Line 154 is foreach (($attributes ?? []) as $option => $value) {
and line 172 is
foreach (($attributes ?? []) as $option => $value) {
If I remove the shopping cart file in the override folder I cannot get the warnings to show.
Is this anything to worry about or is it ok leaving it.