{{ header }}
<ul class="breadcrumb">
  {% for breadcrumb in breadcrumbs %}
  <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
  {% endfor %}
</ul>
{% if j3.settings.get('pageTitlePosition') == 'top' %}
  <h1 class="title page-title">
    <span >
      {{ heading_title }}
    {% if weight %}
      &nbsp;({{ weight }})
    {% endif %}
    </span>
  </h1>
{% endif %}
{{ j3.loadController('journal3/layout', 'top') }}
<div id="checkout-cart" class="container">
  {% if attention %}
  <div class="alert alert-info"><i class="fa fa-info-circle"></i> {{ attention }}
    <button type="button" class="close" data-dismiss="alert">&times;</button>
  </div>
  {% endif %}
  {% if success %}
  <div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
    <button type="button" class="close" data-dismiss="alert">&times;</button>
  </div>
  {% endif %}
  {% if error_warning %}
  <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
    <button type="button" class="close" data-dismiss="alert">&times;</button>
  </div>
  {% endif %}
  <div class="row">{{ column_left }}
    {% if column_left and column_right %}
    {% set class = 'col-sm-6' %}
    {% elseif column_left or column_right %}
    {% set class = 'col-sm-9' %}
    {% else %}
    {% set class = 'col-sm-12' %}
    {% endif %}
    <div id="content" class="{{ class }}">
      {% if j3.settings.get('pageTitlePosition') == 'default' %}
      <h1 class="title page-title">{{ heading_title }}
        {% if weight %}
        &nbsp;({{ weight }})
        {% endif %} </h1>
      {% endif %}
      {{ content_top }}
      <div class="cart-page">
        <form action="{{ action }}" method="post" enctype="multipart/form-data" class="cart-table">
          <div class="table-responsive">
            <table class="table table-bordered">
              <thead>
              <tr>
                <td class="text-center td-image">{{ column_image }}</td>
                <td class="text-left td-name">{{ column_name }}</td>
                <td class="text-center td-model">{{ column_model }}</td>
                <td class="text-center td-qty">{{ column_quantity }}</td>
                <td class="text-center td-price">{{ column_price }}</td>
                <td class="text-center td-total">{{ column_total }}</td>
              </tr>
              </thead>
              <tbody>

              {% for product in products %}
                <tr>
                  <td class="text-center td-image">{% if product.thumb %} <a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" /></a> {% endif %}</td>
                  <td class="text-left td-name"><a href="{{ product.href }}">{{ product.name }}</a> {% if not product.stock %} <span class="text-danger">***</span> {% endif %}
                      {% if product.option %}
                          {% for option in product.option %} <br />
                            <small>{{ option.name }}: {{ option.value }}</small> {% endfor %}
                      {% endif %}
                      {% if product.reward %} <br />
                        <small>{{ product.reward }}</small> {% endif %}
                      {% if product.recurring %} <br />
                        <span class="label label-info">{{ text_recurring_item }}</span> <small>{{ product.recurring }}</small> {% endif %}</td>
                  <td class="text-center td-model">{{ product.model }}</td>
                  <td class="text-center td-qty">
                    <div class="input-group btn-block">
                      <div class="stepper">
                        <input type="text" name="quantity[{{ product.cart_id }}]" value="{{ product.quantity }}" size="1" class="form-control" />
                        <span>
                      <i class="fa fa-angle-up"></i>
                      <i class="fa fa-angle-down"></i>
                    </span>
                      </div>
                      <span class="input-group-btn">
                    <button type="submit" data-toggle="tooltip" title="{{ button_update }}" class="btn btn-update"><i class="fa fa-refresh"></i></button>
                    <button type="button" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-remove" onclick="cart.remove('{{ product.cart_id }}');"><i class="fa fa-times-circle"></i></button>
                  </span>
                    </div>
                  </td>
                  <td class="text-center td-price">{{ product.price }}</td>
                  <td class="text-center td-total">{{ product.total }}</td>
                </tr>
              {% endfor %}
              {% for voucher in vouchers %}
                <tr>
                  <td></td>
                  <td class="text-left td-voucher">{{ voucher.description }}</td>
                  <td class="text-left td-voucher"></td>
                  <td class="text-left td-voucher"><div class="input-group btn-block" style="max-width: 200px;">
                      <input type="text" name="" value="1" size="1" disabled="disabled" class="form-control" />
                      <span class="input-group-btn">
                  <button type="button" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger" onclick="voucher.remove('{{ voucher.key }}');"><i class="fa fa-times-circle"></i></button>
                  </span></div></td>
                  <td class="text-right td-voucher">{{ voucher.amount }}</td>
                  <td class="text-right td-voucher">{{ voucher.amount }}</td>
                </tr>
              {% endfor %}
              </tbody>
            </table>
          </div>
        </form>
        <div class="cart-bottom">
          <div class="panels-total">
              {% if modules and j3.settings.get('cartPanelsStatus') %}
                <div class="cart-panels">
                  <h2 class="title">{{ text_next }}</h2>
                  <p>{{ text_next_choice }}</p>
                  <div class="panel-group" id="accordion"> {% for module in modules %}
                          {{ module }}
                      {% endfor %}
                  </div>
                </div>
              {% endif %}
            <div class="cart-total">
              <table class="table table-bordered">
                  {% for total in totals %}
                    <tr>
                      <td class="text-right"><strong>{{ total.title }}:</strong></td>
                      <td class="text-right">{{ total.text }}</td>
                    </tr>
                  {% endfor %}
              </table>
            </div>
          </div>
          <div class="buttons clearfix">
            <div class="pull-left"><a href="{{ continue }}" class="btn btn-default"><span>{{ button_shopping }}</span></a></div>
            <div class="pull-right"><a href="{{ checkout }}" class="btn btn-primary"><span>{{ button_checkout }}</span></a></div>
          </div>
        </div>
      </div>
      {{ content_bottom }}</div>
    {{ column_right }}</div>
</div>
{{ footer }}
