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.
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.
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.
<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