Expand
foreach ($products as $row) { // hack start if( end($products) === $row ) { $row['first_order_message'] = nl2br($order->getFirstMessage()); $CustomerThread_messagelar = CustomerMessage::getMessagesByOrderId($order->id, $private = false); // last Customer Message private = false $row['CustomerThread_message'] = $CustomerThread_messagelar[0][message]; // last Customer Message }
You are retrieving the same message inside the products loop... the message should only be retrieved once and outside the loop.