Creating a select box with order statuses in the plugin admin panel

Hi.

I am developing a payment plugin for Shopware 6.7. Please tell me how to get a select box on the plugin settings page in the admin panel that will only contain order statuses.

Currently, I can get a select box with all system statuses, but that’s not what I need.

There are three different kind of states. Filter for technical_name: order_transaction.state

I think you mean other statuses.
Here is a fragment of my plugin file from config.xml:

<component name="procardpay-order-state-select">
            <name>defaultOrderStatus</name>
            <label>Default Order Status (Approved)</label>
            <help-text>Order status in Shopware after successful payment via ProcardPay.</help-text>
            <multi>false</multi>
            <required>true</required>
            <entity>state_machine_state</entity>
            <value-field>id</value-field>
            <label-field>translated.name</label-field>
        </component>

I also made a custom component that provides values for this select.

You are right. I read about the payment plugin, so I jumped to an early conclusion.

state_machine_state contains all states, you have to set a filter when requesting the entity.

I understand that, I’ve already figured it out. But I’m interested in the implementation of this filter. Because all my attempts to do it have been unsuccessful.

Never done that, but AI tells me ti add within the component.

<criteria>
        <filter>
            <type>equals</type>
            <field>stateMachine.technicalName</field>
            <value>order.state</value>
        </filter>
    </criteria>
<component name="sw-entity-single-select">
            <name>defaultOrderStatus</name>
            <label lang="en-GB">Default Order Status (Approved)</label>
            <label lang="uk-UA">Статус замовлення за замовчуванням (Схвалено)</label>
            <label lang="ru-RU">Статус заказа по умолчанию (Одобрено)</label>
            <help-text lang="en-GB">Order status in Shopware after successful payment via ProcardPay.</help-text>
            <help-text lang="uk-UA">Статус замовлення в Shopware після успішної оплати через ProcardPay.</help-text>
            <help-text lang="ru-RU">Статус заказа в Shopware после успешной оплаты через ProcardPay.</help-text>
            <multi>false</multi>
            <required>true</required>
            <entity>state_machine_state</entity>
            <criteria>
                <filter>
                    <type>equals</type>
                    <field>stateMachine.technicalName</field>
                    <value>order.state</value>
                </filter>
            </criteria>
            <valueProperty>id</valueProperty>
            <labelProperty>translated.name</labelProperty>
        </component>

This option does not work. Error in the browser console:

app.js?1752403431:86 An error was captured in current module: TypeError: this.criteria.setPage is not a function

This is from 2001, but then it was explained that it is not possible. You need your own component.

https://stackoverflow.com/questions/74400367/how-can-we-filter-the-options-of-an-entity-select-component-in-the-app-config