stefandoorn / sylius-street-number-plugin
Split number from street per address Sylius.
Installs: 9 784
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 8
Type:sylius-plugin
Requires
- php: ^8.0
- sylius/sylius: ^1.10
Requires (Dev)
- behat/behat: ^3.4
- behat/mink: ^1.7@dev
- behat/mink-browserkit-driver: ^2.0
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/mink-debug-extension: ^2.0
- friends-of-behat/page-object-extension: ^0.3.0
- friends-of-behat/service-container-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.0
- friends-of-behat/variadic-extension: ^1.1
- matthiasnoback/symfony-dependency-injection-test: ^4.0
- phpspec/phpspec: ^7.0
- phpstan/phpstan: ^1.0
- phpstan/phpstan-doctrine: ^1.0
- phpstan/phpstan-symfony: ^1.0
- phpstan/phpstan-webmozart-assert: ^1.0
- phpunit/phpunit: ^9.5
- sylius-labs/coding-standard: ^4.0
- symfony/browser-kit: ^4.4 || ^5.4 || ^6.0
- symfony/debug-bundle: ^4.4 || ^5.4 || ^6.0
- symfony/dotenv: ^4.4 || ^5.4 || ^6.0
- symfony/intl: ^4.4 || ^5.4 || ^6.0
- symfony/web-profiler-bundle: ^4.4 || ^5.4 || ^6.0
- symfony/web-server-bundle: ^4.4 || ^5.4 || ^6.0
This package is auto-updated.
Last update: 2024-10-31 00:19:34 UTC
README
This plugin helps you split street & number.
Features:
- Add
streetNumber
field to Address form (and database)
Optional features:
- Add
streetNumberAddition
field to Address form (and database)
Installation
-
Require plugin with composer:
composer require stefandoorn/sylius-street-number-plugin:^1.0@beta
-
Add plugin class to your
AppKernel
.$bundles = [ new \StefanDoorn\SyliusStreetNumberPlugin\SyliusStreetNumberPlugin(), ];
-
Add to your config:
- { resource: "@SyliusStreetNumberPlugin/Resources/config/config.yml" }
-
Add doctrine mapping fields for table
sylius_address
(seetests/Application/config/doctrine/Address.orm.yml
):... table: sylius_address fields: number: column: street_number type: string nullable: false options: default: '' addition: column: street_number_addition type: string nullable: true
The
streetNumberAddition
field is always added, regardless whether you use it. It will benull
in that cae. -
Add to
_sylius.yaml
:... sylius_addressing: resources: address: classes: model: App\Entity\Addressing\Address
-
Add to
SyliusAdminBundle/views/Common/Form/_address.html.twig
:{{ form_row(form.number) }}
-
Add to
SyliusShopBundle/views/Common/Form/_address.html.twig
:{{ form_row(form.number) }}
-
Update database:
$ bin/console doctrine:migrations:diff $ bin/console doctrine:migrations:migrate
(Optional) Add streetNumberAddition
field
-
Enable in config (for form extension):
sylius_street_number: features: street_number_addition: true
-
Add to
SyliusAdminBundle/views/Common/Form/_address.html.twig
:{{ form_row(form.addition) }}
-
Add to
SyliusShopBundle/views/Common/Form/_address.html.twig
:{{ form_row(form.addition) }}