<style>
.col-md-5.border.sticky-div {
    position: sticky !important;
    top: 0;
}
</style>

<?php if (isset($cart) && !empty($cart)) { ?>

<div class="box-grey rounded  relative cartDetailsdiv">
	<i class="order-icon your-order-icon"></i>
    <img alt="order-basket" src="assets/images/pickup_iconNew.png" style="width: 60px;position: absolute;top: 5px;">
    <div class="order-list-wrap">
		<p class="ordersumhead bold center">Order Summary</p>
		<div class="item-order-wrap">
			<?php
			if(isset($cart['data'])) {
			foreach ($cart['data']['item'] as $key => $order) { 
			
			
				if($order['size_words']){
				$size_words='('.$order['size_words'].')';
				}else{
					$size_words='';
				}?>
				<div class="item-order-list item-row cust-item<?= $key; ?>">
                    <div class="a"></div>
                    <div class="b uk-text-success"><?= $order['category_name'];  ?></div>
					<p style="margin:0;"></p>
					<div class="a"><?= $order['qty']; ?></div>
					<div class="b"><?= $order['item_name'].$size_words; ?>
						<p class="uk-text-small">
							<span class="base-price"><?= $_SESSION['settings']['currency_symbol'].$order['normal_price']; ?></span>
						</p>
                        <p class="small text-info"><?= $order['order_notes']; ?></p>
						<p class="small ingredients-label"><?= $order['cooking_ref']; ?></p>
                    </div>
					<div class="manage">
						<div class="c">
							<a onclick="menu.showItem(<?= $order['item_id']; ?>,<?= $order['category_id']; ?>,<?= $key; ?>,<?= $order['qty']; ?> )" class="edit_item">
								<i class="ion-compose"></i>
							</a>
							<a onclick="menu.deleteItem(<?= $key; ?>)" class="delete_item" >
								<i class="ion-trash-a"></i>
							</a>
						</div>
						<div class="d"><?= $_SESSION['settings']['currency_symbol'].($order['qty'] * $order['discounted_price']); ?></div>
					</div>
					<div class="clear"></div>

                    <?php if(isset($order['sub_item'])) { foreach ($order['sub_item'] as $sb_item) {?>
                        <div class="a"></div>
                        <div class="b uk-text-success"><?= $sb_item['addon_category'];  ?></div>
                        <div class="clear"></div>
                        <div class="a"><?= $sb_item['addon_qty'];  ?></div>
                        <div class="b uk-text-muted"><?= $sb_item['addon_name'];  ?>
                        <p class="uk-text-small">
								<span class="base-price"><?= $_SESSION['settings']['currency_symbol'] . $sb_item['addon_price']; ?></span>
						</p>
                        </div>
                        <div class="manage"><div class="d"><?= $_SESSION['settings']['currency_symbol'] .$sb_item['addon_price'];  ?></div></div>
                        <div class="clear"></div>
                    <?php }} ?>
				</div>
			<?php } ?>
			<div class="summary-wrap cust-summary">
			    <?php if($cart['data']['total']['voucher_type']) { ?>
			    <div class="row voucher">
					<div class="col-md-6 col-xs-6 text-right ">Less Voucher <?= $cart['data']['total']['voucher_type'];  ?></div>
					<div class="col-md-6 col-xs-6 text-right cart_subtotal"><?= $_SESSION['settings']['currency_symbol'].$cart['data']['total']['less_voucher']; ?></div>
				</div><?php } ?>
				<?php if ($cart['data']['total']['discounted_amount']>0) { ?>
                <div class="row">
                    <div class="col-md-6 col-xs-6 text-right "><?= $cart['data']['total']['merchant_discount_amount']; ?>% Discount Offer</div>
                    <div class="col-md-6 col-xs-6 text-right cart_subtotal">
                        <?= $_SESSION['settings']['currency_symbol'] . $cart['data']['total']['discounted_amount'] ; ?>
                    </div>
                </div>
                <?php } ?>
				<div class="row">
					<div class="col-md-6 col-xs-6 text-right ">Sub Total</div>
					<div class="col-md-6 col-xs-6 text-right cart_subtotal"><?= $_SESSION['settings']['currency_symbol'].$cart['data']['total']['subtotal']; ?></div>
				</div>
				<?php if($_SESSION['deliveryData']['transaction_type'] == 'delivery') { ?>
				<div class="row">
					<div class="col-md-6 col-xs-6 text-right">Delivery Fee</div>
					<div class="col-md-6 col-xs-6 text-right "><?= $_SESSION['settings']['currency_symbol'].number_format($cart['data']['total']['delivery_charges']); ?></div>
				</div><?php } ?>
				<div class="row cart_total_wrap bold">
					<div class="col-md-6 col-xs-6  text-right">Total</div>
					<div class="col-md-6 col-xs-6  text-right cart_total"><?= $_SESSION['settings']['currency_symbol'].$cart['data']['total']['total']; ?></div>
				</div>
				<input type="hidden" value="" name="subtotal_order" id="subtotal_order"><input type="hidden" value="" name="subtotal_order2" id="subtotal_order2"><input type="hidden" value="" name="subtotal_extra_charge" id="subtotal_extra_charge">
			</div>
		</div>
		<?php } else { ?>
			<div class="item-order-wrap" bis_skin_checked="1">
				<div class="center" bis_skin_checked="1">No Item added yet!</div>
			</div>
		<?php } ?>
		<?php if($cart['merchant_settings']['enabled_voucher'] == 'yes') { ?>
		<div class="voucher_wrap">
		
		
			<?php if($cart['data']['total']['voucher_type']) { ?>
			<a href="javascript:;" onclick="remove_voucher()" class="green-button remove_voucher">Remove Voucher</a>
			<?php }else{ ?>
				<input placeholder="Enter Voucher here" class="grey-fields center" style="" type="text" value="" name="voucher_code" id="voucher_code">
				<a href="javascript:;" onclick="use_voucher()" class="green-button apply_voucher">Use Voucher</a>
			<?php
			}?>
		</div>
		
		<?php } ?>
		<div class="text-center top25">
			<input type="submit" value="Place Order" class="place_order green-button medium inline block">
		</div>
	</div>
</div>
<?php } ?>
