{% for offernumber in offers %}
{% for offer in offernumber %}
<div class="{{ offer.id }} availableofferblock">
<h3 class="offerheading">{{ offer.name }}</h3>
{% if offer.offerpage is defined and offer.offerpage %}
<label>{{ offer.offerpage }}</label>
{% endif %}

{# Modify / Add On #}
{% for key,product in offer.getproducts %}
  {% if product.secqty == 0 %}

  {% else %}

    {% if offer.offervalue is defined and offer.offervalue %}
    <div class="offerhexagon"><span>{{ offer.offervalue }}</span></div>
    {% endif %}

  {% endif %}
{% endfor %}
{# ENd of Modify / Add On #}

<div class="addproducts">


{% for key,product in offer.addproducts %}
<input type="hidden" name="offer_productid" value="{{ product.product_id }}" id="{{ product.priqty }}">
{% if key %}
<div class="product-layout col-xsm-1 col-xxs-1 plussign">
<i class="fa fa-plus" aria-hidden="true"></i>
</div>
{% endif %}
<div class="product-layout col-xlg-2 col-xsm-3 col-xxs-4">
  <div class="gift-thumb transition">
    <div class="image"><a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" /></a>
      <span class="qtyoffer">{{ addqty }} {{ product.priqty }}</span>
      {% if product.optionnames is defined and product.optionnames %}
       <br>{{ foroptions }}<br>{{ product.optionnames }}
      {% endif %}
    </div>
  </div>
</div>
{% endfor %}



{% if offer.getproducts is defined %}
{% for key,product in offer.getproducts %}
{# Modify / Add On #}
{% if product.secqty == 0 %}
<div class="twin-pack">

</div>
{% else %}
<input type="hidden" name="offer_productid" value="{{ product.product_id }}" id="{{ product.secqty }}">
<div class="product-layout col-xsm-1 col-xxs-1 plussign">
<i class="fa fa-plus" aria-hidden="true"></i>
</div>
<div class="product-layout col-xlg-2 col-xsm-3 col-xxs-4">
  <div class="gift-thumb transition">
    <div class="image"><a href="{{ product.href }}"><img src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive" /></a>
     <span class="qtyoffer">{{ getqty }} {{ product.secqty }}
      {% if product.optionnames is defined and product.optionnames %}
       <br>{{ foroptions }}<br>{{ product.optionnames }}</span>
      {% endif %}
    </div>
    <div class="offerblockproduct"><span class="offerblockvalue">{{ offertag }}</span></div>
  </div>
</div>
{% endif %}
{# End of Modify / Add On #}
{% endfor %}
{% endif %}
{% if offer.getcategories is defined %}
{% for key,category in offer.getcategories %}
<div class="product-layout col-xsm-1 col-xxs-1 plussign">
<i class="fa fa-plus" aria-hidden="true"></i>
</div>
<div class="product-layout col-xlg-2 col-xsm-3 col-xxs-4">
  <div class="gift-thumb transition">
    <div class="image"><a href="{{ category.href }}"><img src="{{ category.thumb }}" alt="{{ category.name }}" title="{{ category.name }}" class="img-responsive" /></a>
    <span class="qtyoffer">{{ getqty }} {{ category.secqty }}</span>
    </div>
    <div class="offerblockproduct"><span class="offerblockvalue">{{ offertag }}</span></div>
  </div>
</div>
{% endfor %}
{% endif %}
</div>
{% if offer.bundle is defined and offer.bundle %}
<button type="button" onclick="offer('{{ offer.id }}');" class="btn btn-primary"><i class="fa fa-shopping-cart"></i> {{ button_bundle }}</button>
<script type="text/javascript">
function offer(id) {
  $(".availableofferblock."+id + " input[name=offer_productid]").each(function() {
    cart.add($(this).val(),$(this).attr("id"));
  });
};
</script>
{% endif %}
</div>
{% endfor %}
{% endfor %}
