В корзине есть 2 товара, но выводится только последний.
$order = array( "items" => array(
array (
'title' => @iconv("windows-1251", "UTF-8", $_POST['title']),
'category' => @iconv("windows-1251", "UTF-8", $_POST['category']),
'qty' => $_POST['qty'],
'price' => $_POST['price']
),
),
"details" => array(
'firstname' => $_POST['firstname'],
'lastname' => $_POST['lastname'],
'middlename' => $_POST['middlename'],
'email' => $_POST['email'],
'cellphone' => $_POST['cellphone']
),
);
echo "<pre>";
print_r ($order);
echo "<pre>";
Подскажите, как сделать чтоб в items выводились все товары?
Вот так:
Array
(
[items] => Array
(
[0] => Array
(
[title] => Товар1
[category] => Мебель
[qty] => 1
[price] => 1
)
[1] => Array
(
[title] => Товар2
[category] => Мебель
[qty] => 1
[price] => 1
)
)
[details] => Array
(
[firstname] => 123
[lastname] => 123
[middlename] => 123
[email] => 123@123.ru
[cellphone] => 12345
)
)