<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

$this->title = 'Оформление заказа';
$this->params['breadcrumbs'][] = $this->title;

?>
<div class="basket_form basket_result">
	<?php $form = ActiveForm::begin([
		'class' => 'basket_order_01_form'
	]); ?><!-- начало формы заказа -->

	<h1 class="basket_main_title">Оформление заказа</h1>
	<div class="order_list">
		<h3>Номер заказа <?= $order_id?></h3>
		<ul>
			<?php foreach($items as $item){

				?>

				<li>
					<div class="order_list_li" data-id="<?= $item['item']->product_variant_id?>">
						<div class="delete_item_btn"><i class="fa fa-times"></i></div>
						<div class="little_img">
							<?php if (empty($item['item']->product->image)) :?>
								<img src="/storage/no_photo.png">
							<?php else :?>
								<img src="/storage/products/<?= $item['item']->product->image->image?>" alt="<?= $item['item']->product->image->alt ? $item['item']->product->image->alt : $item['item']->product->name?>">
							<?php endif?>
						</div>
						<div class="name_and_code">
							<span class="name"><?= $item['item']->name?></span>
							<span class="code"> Код: 45885-01016049</span>
						</div>
						<div class="count_block_wrap">
							<div class="count_block">
								<input type="text" name="" class="form-control buy_one_item" value="<?= $item['num']?>">
								<div class="count_buttons">
									<div class="button_plus">+</div>
									<div class="button_minus">-</div>
								</div>
							</div>
							<div class="price"><span class="price_val" data-price="<?= $item['item']->price ?>"><?= $item['item']->price * $item['num'] ?></span><span class="price_text">грн.</span></div>
						</div>
					</div>
				</li>
			<?php } ?>

		</ul>
		<hr>
		<div class="all_price">
			<p>Всего товаров: <span class="all_count"><?= $count ?></span></p>
			<p>Сумма: <span class="all_price all_price_span"><?= $price ?></span> грн.</p>
		</div>
		<hr>
	</div>

	<div class="basket_step_2_delivery">
		<h3>Детали</h3>
		<div class="detail">
			<span class="grey">Имя</span><?= $order_model->name ?>
		</div>
		<div class="detail">
			<span class="grey">E-mail</span><?= $order_model->email ?>
		</div>
		<div class="detail">
			<span class="grey">Телефон</span><?= $order_model->phone ?>
		</div>
		<h4>Способ оплаты</h4>
		<div class="detail">Оплата наличными</div>
		<h4>Доставка</h4>
		<div class="detail">Курьерска доставка по Киеву и области</div>
	</div>

	<div class="for_margin_2">
		<?= Html::submitButton(Yii::t('app', 'оформить заказ'), ['class' => 'order_01_btn', 'name' => 'signup-button']) ?>
	</div>

	<?php ActiveForm::end(); ?><!-- конец формы заказа -->
</div>

