{% assign similar_count = 0 | plus: 0 %} {% assign categories_names = course.categories | map: "name" %} {% assign property = "" %}
SIMILAR COURSES
{% for checked_course in courses.in_catalog %} {% if checked_course.id != course.id %} {% for category in checked_course.categories %} {% if categories_names contains category.name %} {% capture course_path %}{% route course, id: checked_course.id %}{% endcapture %}
{{ checked_course.name }}
{% assign similar_count = similar_count | plus: 1 %} {% break %} {% endif %} {% endfor %} {% endif %} {% if similar_count == 5 %} {% break %} {% endif %} {% endfor %}
More courses