derniercri / sylius-settings-plugin
Add a settings panel to your Sylius.
Installs: 1 168
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 19
Type:sylius-plugin
Requires
- php: ~7.4 || ~8.0
- ext-json: *
- ext-mbstring: *
- sylius/sylius: ^1.10
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.1
- friendsofsymfony/oauth-server-bundle: ^1.6 || >2.0.0-alpha.0 ^2.0@dev
- lchrusciel/api-test-case: ^3.0 || ^5.0
- phpmd/phpmd: @stable
- phpspec/phpspec: ^7.0
- phpstan/phpstan: ^0.12.84
- sensiolabs/security-checker: ^6.0
- sylius-labs/coding-standard: ^4.0
- symfony/browser-kit: ^4.4 || ^5.2
- symfony/debug-bundle: ^4.4 || ^5.2
- symfony/dotenv: ^4.4 || ^5.2
- symfony/intl: ^4.4 || ^5.2
- symfony/web-profiler-bundle: ^4.4 || ^5.2
- symfony/web-server-bundle: ^4.4 || ^5.2
Replaces
This package is auto-updated.
Last update: 2024-10-22 21:55:52 UTC
README
Settings for Sylius
This plugin gives you the ability to have Plugins oriented settings in your favorite e-commerce platform, Sylius.
Installation
Install the plugin via composer:
composer require monsieurbiz/sylius-settings-plugin
For the installation without flex, follow these additional steps
Change your config/bundles.php
file to add this line for the plugin declaration:
<?php
return [
//..
MonsieurBiz\SyliusSettingsPlugin\MonsieurBizSyliusSettingsPlugin::class => ['all' => true],
];
Copy the plugin configuration files in your config
folder:
cp -Rv vendor/monsieurbiz/sylius-settings-plugin/recipes/1.0-dev/config/ config
Update your database:
bin/console doctrine:migration:migrate
Continue to "How it works" to add your first setting for your store.
Note: you may encounter an error during the installation via composer if you let it run the scripts.
Copy the configuration files and rerun the composer require
, it should work. This is due to the use of other plugins in the DI.
The configuration is then required to run any console command.
How it works
As a good start you can have a look at:
- The configuration file to add your own settings.
- The form with your own fields.
Then you can get your settings using a twig function: setting()
.
Have a look at this example.
You can also use the DI to get your Settings, as example with the settings in the test Application app.default
:
$ ./bin/console debug:container | grep app.settings.default
MonsieurBiz\SyliusSettingsPlugin\Settings\Settings $defaultSettings alias for "app.settings.default"
MonsieurBiz\SyliusSettingsPlugin\Settings\SettingsInterface $defaultSettings alias for "app.settings.default"
app.settings.default MonsieurBiz\SyliusSettingsPlugin\Settings\Settings
Note: the "Settings" menu won't appear until you have at least one setting.
Contributing
You can find a way to run the plugin without effort in the file DEVELOPMENT.md.
Then you can open an issue or a Pull Request if you want! 😘
Thank you!
License
This plugin is completely free and released under the MIT License.