{% assign popular_count = 0 | times: 1 %}
{% assign latest_count = 0 | times: 1 %}


<div class="courses-for-carousel np-hidden">
  {% for course in courses.in_catalog %}
    {% if popular_count < 5 %}
      {% if course.properties.popular %}
        {% assign property = 'popular' %}
        {% include 'courses_list_course_card' with course %}
        {% assign popular_count = popular_count | plus: 1 %}
      {% endif %}
    {% endif %}
    {% if latest_count < 5 %}
      {% if course.properties.latest_order < 10 %}
        {% assign property = 'latest' %}
        {% include 'courses_list_course_card' with course %}
        {% assign latest_count = latest_count | plus: 1 %}
      {% endif %}
    {% endif %}
  {% endfor %}
</div>