Answer the question
In order to leave comments, you need to log in
How does he get the result in ( prestashop ) through a double foreach?
foreach ($products as $kp => $p)
foreach ($grades_comments as $gc)
if ($gc['id_product'] == $p['id_product'])
{
$products[$kp]['mymodcomments']['grade_avg'] = round($gc['grade_avg']);
$products[$kp]['mymodcomments']['nb_comments'] = $gc['nb_comments'];
}
$find['result'] = $products;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question