<div id="cart" class="btn-group btn-block">
  <button type="button" data-toggle="dropdown" data-loading-text="{{ text_loading }}" class="btn btn-inverse btn-block btn-lg dropdown-toggle">
    <i class="fa fa-shopping-cart"></i>
    <span id="cart-total" class="{% if logged %}{{ text_items_login }}{% else %}{{ text_items_unlogin }}{% endif %}">
        {{ text_items }}
    </span>
  </button>
  <ul class="dropdown-menu pull-right">
    {% if products or vouchers %}
    <li>
      <p>{{ text_recently }}</p>
      <table class="table table-striped cart-table">
        {% for product in products %}
        {% if loop.index > 3 %}

        {% else %}
          <tr class="{{ loop.index }}">
            <td class="text-left" style="width:125px;">{% if product.thumb %} <a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-thumbnail" /></a> {% endif %}</td>
                <td class="text-left cart-price"><a href="{{ product.href }}">{{ product.name }}</a> {% if product.option %}
                  {% for option in product.option %} <br />
                  - <small>{{ option.name }} {{ option.value }}</small> {% endfor %}
                  {% endif %}
                  {% if product.recurring %} <br />
                - <small>{{ text_recurring }} {{ product.recurring }}</small> {% endif %} <br/>
                   {{ text_item }}{{ product.model }}
                </td>
                <td class="text-left">{{ text_qty }}{{ product.quantity }}</td>
                <td class="text-left">
                  {{ product.total }}<br/>
                  {% if logged %}
                    {{ text_bv }} {{ product.reward }}
                  {% endif %}
                </td>
                <td class="text-center"><button type="button" onclick="cart.remove('{{ product.cart_id }}');" title="{{ button_remove }}" class="btn btn-danger btn-xs btn-red"><i class="fa fa-times"></i></button></td>
          </tr>
        {% endif %}


        {% endfor %}
        {% for voucher in vouchers %}
        <tr>
          <td class="text-center"></td>
          <td class="text-left">{{ voucher.description }}</td>
          <td class="text-right">x&nbsp;1</td>
          <td class="text-right">{{ voucher.amount }}</td>
          <td class="text-center text-danger"><button type="button" onclick="voucher.remove('{{ voucher.key }}');" title="{{ button_remove }}" class="btn btn-danger btn-xs"><i class="fa fa-times"></i></button></td>
        </tr>
      {% endfor %}
      </table>
    </li>

    <li>
      <div>

        {# <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 class="cart-inside">
          <div class="cart-inside-button">
            <a href="{{ cart }}"><i class="fa fa-shopping-cart" style="display:none;"></i> {{ text_cart }}</a>
          </div>
          {% if products %}
            {% for product in products %}

            {% if loop.last %}
              <div class="">
                {% if loop.index > 3 %}
                  <!-- {{ loop.index|last - 3 }} {{ text_more_product }} -->
                  {{ loop.index - 3 }} {{ text_more_product }}
                {% else %}
                  <!-- 0 {{ text_more_product }} -->
                {% endif %}
              </div>
            {% endif %}

            {% endfor %}
          {% endif %}


          <div class="cart-inside-button-nd">
            <a href="{{ checkout }}"><i class="fa fa-share" style="display:none;"></i> {{ text_checkout }}</a>
          </div>
        </div>


      </div>
    </li>

    {% else %}
    <li>
      <p class="text-center">{{ text_empty }}</p>
    </li>
    {% endif %}
  </ul>
</div>
