Search code examples
shopware

How to filter out the order status in frontend at orders overview in shopware6


I am trying to filter the order status depending on the orderstatus at frontend.

enter code here

  {% block page_account_orders_overview %}
                            <div class="account-orders-overview">
                                {% block page_account_orders_table %}
                                    {% block page_account_orders_table_body %}
                                        {% for order in page.orders %}
                                            {% set orderState = order.stateMachineState.technicalName %}
                                            {% if order.type == in_progress %}
                                            <div class="table order-table"
                                                 data-order-detail-loader="true">
                                                {% sw_include '@Storefront/storefront/page/account/quotationorder-history/quotationorder-item.html.twig' %}
                                            </div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endblock %}
                                {% endblock %}
                            </div>
                        {% endblock %}

Solution

  • You need to add quotes to a string comparison:

    {% if order.type == "in_progress" %}