I have to make a csv file that work in this way:
Row 1 --> Text Data
Row 2 --> Person Information
Row 3 --> Products information
The Row1 and Row2 are done, I have alrady wirte the code correctly.
The Row3 is a problem becasue need give me back a row for every products, with all their data.
How I can write the code in the way? At moment I havw write this, but the row3 is empty.
$list = array (
array ('Order id', 'Billing Name' , 'Product Title', 'Total Price' ),
array ($order->id, $order->firstname, '', ''),
$listProd = array(),
);
$listProd = array();
foreach ($order->products as $product) {
$listProd = array (
$order->id,
'',
$product->title,
$cart->renderPriceAndCurrency($product->pad_price),
);
}
$local_file = fopen('php://temp', 'r+');
foreach ($list as $row) {
fputcsv($local_file, $row);
}
rewind($local_file);
thank you.