$images = array();
if (isset($query->row['order_product_id']) && !empty($query->row['order_product_id'])) {
$query1 = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product_image WHERE `order_product_id` = '" . (int)$query->row['order_product_id'] . "'");
foreach ($query1->rows as $image) {
if (is_file(DIR_IMAGE . $image['upc'])) {
$images[] = array(
'order_product_image_id' => $image['order_product_image_id'],
'image' => $this->model_tool_image->resize($image['upc'], 433, 433)
);
}
}
}
$date['orders'][$key_order]['products'][$key_product]['images'] = $images;
foreach ($query1->rows as $image) {
if (is_file(DIR_IMAGE . $image['upc'])) {
$images = array(
'order_product_image_id' => $image['order_product_image_id'],
'image' => $this->model_tool_image->resize($image['upc'], 433, 433),
'image2' => $this->model_tool_image->resize($image['foto'], 433, 433)
);
}
// или так (скорее всего вам это и нужно):
if (is_file(DIR_IMAGE . $image['foto'])) {
$images2 = array(
'order_product_image_id' => $image['order_product_image_id'],
'image2' => $this->model_tool_image->resize($image['foto'], 433, 433)
);
}