Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Show first category

Adam Bogdał692951f7a0b5
diff --git a/saleor/product/templates/product/details.html b/saleor/product/templates/product/details.html
index 131ab86c44..837a2481aa 100644
--- a/saleor/product/templates/product/details.html
+++ b/saleor/product/templates/product/details.html
@@ -12,7 +12,11 @@
{% block breadcrumb %}
{{ block.super }}
- <li><a href="{{ product.category.get_absolute_url }}">{{ product.category }}</a></li>
+ {% with product.get_first_category as category %}
+ {% if category %}
+ <li><a href="{{ category.get_absolute_url }}">{{ category }}</a></li>
+ {% endif %}
+ {% endwith %}
<li><a href="{{ product.get_absolute_url }}">{{ product }}</a></li>
{% endblock breadcrumb %}