To add custom theme configuration fields in shopware 5 follow the below steps:
Step 1: Go to shopware theme directory of your website.
Step 2: Click on the Theme.php file to add the configuration field.

Step 3: Add below code in Theme.php file.
use Shopware\Components\Form as Form; //container element
/**
* @param Form\Container\TabContainer $container
*/
public function createConfig(Form\Container\TabContainer $container)
{
// Create the fieldset which is the container of our field
$fieldset = $this->createFieldSet(
'my_custom_settings',
'My custom settings'
);
// Create the textfield
$textField = $this->createTextField(
'basic_font_size',
'Basic font size',
'16px'
);
// Create the color picker field
$colorPickerField = $this->createColorPickerField(
'custom-color-main',
'Main color',
'#62b74b'
);
// Adding the fields to the fieldset
$fieldset->addElement($textField);
$fieldset->addElement($colorPickerField);
// Create the tab which will be named "My custom colors"
$tab = $this->createTab(
'my_custom_tab',
'My custom tab'
);
// add the fieldset to the tab
$tab->addElement($fieldset);
// add the tab to the container, which is a tab panel.
$container->addTab($tab);
}
Step 4: Now go to the theme section of the backend and click on the Configure theme.

Step 5: Now you can see the newly created My custom tab just like below screenshot.

Result:

Please contact us at manish@bay20.com or call us at +91-8800519180 for any support related to shopware 5 and shopware 6. You can also visit the Shopware development page to check the services we offer.






