p16r.nl

Shopware 6 - Plugin config button does not show up

September 02, 2020 - 1 min read

I was building a Default Sort Order plugin in Shopware 6 and created a config field for the plugins configuration:

custom/plugins/ExamplePlugin/src/Resources/config/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/platform/master/src/Core/System/SystemConfig/Schema/config.xsd">
    <card>
        <title>ExamplePlugin Settings</title>

        <input-field type="bool">
            <name>active</name>
            <label>Active</label>
        </input-field>

        <input-field type="bool">
            <name>default-sort-order</name>
            <label>Default sort order</label>
        </input-field>
    </card>
</config>

But when I clicked on the ellipsis in the administration, the Config option did not show up;

image

I then removed the Default Sort Order field and the Config option showed up. Once I opened that page, re-added the field and refreshed the config page, I got this notice;

image

Turns out that the <name> value of an input-field element should be camel-cased instead of snake-cased, however this error notice didn’t show up in the Plugins overview in the backend. Changing it to defaultSortOrder fixed it.


Kyle Mathews

Written by Peter Jaap Blaakmeer @PeterJaap