Installation
- Upload the ZIP file in the Administration under Extensions > My extensions, or copy the folder to
custom/plugins/.
- Install and activate the extension. On the command line:
bin/console plugin:refresh
bin/console plugin:install --activate SgAddressCheck
bin/console cache:clear
- Open Extensions > My extensions > Address check > Configure.
Configuration
All settings can differ per sales channel.
| Setting | Default | Effect |
| Active | on | Turns all checks on or off for the sales channel. |
| Countries to check | empty | Empty checks every country; otherwise only the selected countries. |
| Street must contain a house number | on | The street field needs at least one digit. |
| City must not contain digits | on | Rejects city names such as 80331 München. |
| Custom street pattern | empty | PCRE pattern with delimiters, e.g. /^\D+\s\d+\w?$/u. Replaces the house number check; invalid patterns are ignored. |
The checks run on the server for registration, the address book and address changes in checkout, so they also apply to headless and Store API clients.
Error messages
The texts are snippets and can be changed under Settings > Snippets:
| Key | Default text (English) |
error.VIOLATION::SG_STREET_HOUSE_NUMBER_MISSING | Please enter a house number. |
error.VIOLATION::SG_CITY_CONTAINS_DIGITS | The city must not contain digits. Please enter the postal code in the postal code field. |
FAQ
Are addresses that are already saved checked?
No. The check applies when an address is created or changed. Existing addresses stay as they are until customers edit them.
Some addresses in a country have no house number. What can I do?
Limit the check with “Countries to check” to the countries where house numbers are common, or set a custom street pattern.
Does the check also work for headless shops and the Store API?
Yes. The check runs on the server, not only in the browser, so it applies to every frontend that saves addresses through Shopware.
Does the extension send data to third parties?
No. The extension checks the input locally in your shop, calls no external services and stores nothing besides its configuration.
What happens on uninstall?
Shopware removes the configuration unless you choose “Keep user data”. The extension creates no other data.
Changelog
- 0.1.0
- First version: house number check for the street field and no-digits check for the city field, per country and sales channel.