monsieurbiz / sylius-contact-request-plugin
Add a contact request plugin to your Sylius.
Installs: 3 502
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 5
Open Issues: 0
Type:sylius-plugin
Requires
- php: ^8.0
- monsieurbiz/sylius-rich-editor-plugin: ^2.8.0
- monsieurbiz/sylius-settings-plugin: ^1.2.0
- sylius/sylius: >=1.11 <1.14
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.16
- phpmd/phpmd: ^2.15
- phpspec/phpspec: ^7.0
- phpstan/phpstan: ^1.8.4
- phpstan/phpstan-doctrine: ^1.3.2
- phpstan/phpstan-webmozart-assert: ^1.1
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2025-01-07 09:46:46 UTC
README
Contact Request for Sylius
This plugin allows you to customize the contact page on the front-end of your Sylius store. It stores all contact requests made through the native Sylius form in the database, making them accessible directly from the Sylius back office.
Compatibility
Installation
If you want to use our recipes, you can configure your composer.json by running:
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'
composer require monsieurbiz/sylius-contact-request-plugin
Getting started
Contact page customization
Contact request storage
Submit a contact request from the native contact form. Them go in the back-office in the customer menu node you will have a new menu 'contact requests', click on it and you can see a grid with the contact requests created. Obviously, this plugin is not retroactive and contact requests made before the plugin was installed will not be displayed.
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\SyliusContactRequestPlugin\MonsieurBizSyliusContactRequestPlugin::class => ['all' => true], ];
Create a new file config/packages/monsieurbiz_sylius_contact_request.yaml
and add the following configuration:
imports: - { resource: "@MonsieurBizSyliusContactRequestPlugin/Resources/config/config.yaml" }
Create a new file config/routes/monsieurbiz_sylius_contact_request.yaml
and add the following configuration:
imports: resource: '@MonsieurBizSyliusContactRequestPlugin/Resources/config/routes.yaml'
To override the default sylius route for contact page, create a new file config/routes/sylius_shop_contact_request_override.yaml
and add the following configuration:
sylius_shop_contact_request: path: /{_locale}/contact requirements: _locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$ methods: [GET, POST] defaults: _controller: sylius.controller.shop.contact::requestAction _sylius: redirect: sylius_shop_homepage template: '@MonsieurBizSyliusContactRequestPlugin/Shop/ContactRequest/request.html.twig'
This is the same as Sylius route configuration instead of the template key which is overridden to use the plugin template.
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.