{% set sales = __SELF__.sales %}
{% set order = __SELF__.order %}

    <!-- Breadcumb Area -->
    <div class="breadcumb_area">
        <div class="container h-100">
            <div class="row h-100 align-items-center">
                <div class="col-12">
                    <h5>{{ 'order.SargytMaglumaty'|_ }}</h5>
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="{{ 'index'|page }}">{{ 'breadcrumbEsasySahypa'|_ }}</a></li>
                        <li class="breadcrumb-item"><a href="{{ 'vendor-sales'|page }}">{{ 'breadcrumbYza'|_ }}</a></li>
                        <li class="breadcrumb-item active"># {{ order.id }} {{ 'order.Sargyt'|_ }}</li>
                        
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <!-- Breadcumb Area -->


        <!-- Checkout Area -->
        <div class="checkout_area section_padding_100">
            <div class="container">
                <div class="row">
                    <div class="col-12">
                        <div class="checkout_details_area clearfix">
                            <h5 class="mb-30">{{ 'breadcrumbHarytlar'|_ }}</h5>
    
                            <div class="cart-table">
                                <div class="table-responsive">
                                    <table class="table table-bordered mb-30">
                                        <thead>
                                            <tr>
                                                <th scope="col">{{ 'checkout.Surat'|_ }}</th>
                                                <th scope="col">{{ 'checkout.HarytAdy'|_ }}</th>
                                                <th scope="col">{{ 'checkout.Bahasy'|_ }}</th>
                                                <th scope="col">{{ 'checkout.Mukdary'|_ }}</th>
                                                <th scope="col">{{ 'checkout.Umumy'|_ }}</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            {% set total_price = 0 %}
                                            {% for saleOrder in sales %}
                                            <tr>
                                                <td>
                                                    <a href="{{ 'product'|page({id: saleOrder.product.id}) }}">
                                                        <img src="{{ saleOrder.product.images[0].thumb(60,60, { mode: 'crop' }) }}" alt="Gurluşyk, Gurluşyk platform, bezeg gurluşyk, gipsler merkezi, {{ saleOrder.product.name }}">
                                                    </a>
                                                </td>
                                                <td>
                                                    <a href="{{ 'product'|page({id: saleOrder.product.id}) }}">{{ saleOrder.product.name }}</a>
                                                </td>
                                                <td>{{ saleOrder.product.price }} TMT</td>
                                                <td>{{ saleOrder.qty }}</td>
                                                <td>{{ saleOrder.product.price * saleOrder.qty }} TMT</td>
                                                {% set total_price = total_price + (saleOrder.product.price * saleOrder.qty) %}
                                            </tr>
                                            {% endfor %}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                </div>
                
                <div class="row">
                        <div class="col-6">
                            <div class="cart-total-area">
                                <h5 class="mb-3">{{ 'checkout.BeylekiMaglumatlar'|_ }}</h5>
                                
                                <div class="table-responsive">
                                    <table class="table mb-0">
                                        <tbody>
                                            <tr>
                                                <td>{{ 'checkout.Ulanyjy'|_ }}</td>
                                                <td>{{ order.user.name }}</td>
                                            </tr>
                                            <tr>
                                                <td>{{ 'footer.TelefonTitle'|_ }}</td>
                                                <td>+993 {{ order.user.username }}</td>
                                            </tr>
                                            <tr>
                                                <td>{{ 'checkout.Address'|_ }}</td>
                                                <td>{{ order.address }}</td>
                                            </tr>
                                            <tr>
                                                <td>{{ 'checkout.Bellik'|_ }}</td>
                                                <td>{{ order.note }}</td>
                                            </tr>
                                            
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
        
                        <div class="col-6">
                        
                            <div class="cart-total-area">
                                <h5 class="mb-3">{{ 'checkout.Jemi'|_ }}</h5>
                                <div class="table-responsive">
                                    <table class="table mb-0">
                                        <tbody>
                                            <tr>
                                                <td>{{ 'checkout.Jemi'|_ }}</td>
                                                <td>{{ total_price }} TMT</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="checkout_pagination d-flex justify-content-end mt-3">
                                    <form action="#"
                                        data-request="onConfirm"
                                        data-request-flash
                                        data-request-validate
                                    >
                                        <input type="hidden" name="order_id" value="{{ order.id }}">
                                        {% if order.status != 'new' %}                
                                            <a href="{{ 'print'|page }}" target="_blank" class="btn btn-primary mt-2 ml-2">{{ 'order.Print'|_ }}</a>    
                                        {% else %}
                                            <button type="submit" class="btn btn-primary mt-2 ml-2">{{ 'zakaz.KabulEtmek'|_ }}</button>
                                        {% endif %}
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                
                
            </div>
        </div>
        <!-- Checkout Area End -->
    