bitbag / sylius-customer-reorder-plugin
Sylius plugin that enables order reordering for a customer
Installs: 3 607
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 25
Type:sylius-plugin
Requires
- php: ^7.4 || ^8.0
- bitbag/coding-standard: ^v2.0.2
- sylius/sylius: ~1.10.0 || ~1.11.0
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- friendsofsymfony/oauth-server-bundle: ^1.6 || >2.0.0-alpha.0 ^2.0@dev
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^1.10.0
- phpstan/phpstan-doctrine: ^1.3.37
- phpstan/phpstan-strict-rules: ^1.5.0
- phpstan/phpstan-webmozart-assert: ^1.2.4
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- 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
- vimeo/psalm: 4.7.1
Conflicts
- doctrine/orm: >=2.15.2
This package is auto-updated.
Last update: 2024-10-29 15:32:57 UTC
README
⚠️ BEWARE! This repository has been deprecated and will not be maintained or evolved by the Sylius Team. You can still use it with compatible Sylius versions, but at your own risk, as no bugs will be fixed on it.
Customer Reorder Plugin
This plugin allows customers to reorder a previously placed order.
Business value
The plugin allows Customer to reorder any Order that has already been placed. Once a Reorder button is clicked, a new cart filled with items taken from a previously placed order is created. If for some reason Reorder can't be fulfilled completely, the Customer is informed about every circumstance that have affected the Order (i. e. promotion being no longer available or differences in item's prices).
Once the Reorder process is completed, the newly created Order is listed in the history just like any other Orders.
Installation
Beware!
This installation instruction assumes that you're using Symfony Flex. If you don't, take a look at the legacy installation instruction. However, we strongly encourage you to use Symfony Flex, it's much quicker! :)
To install plugin, just require it with composer:
composer require sylius/customer-reorder-plugin
Remember to allow community recipes with
composer config extra.symfony.allow-contrib true
or during plugin installation process
Extension points
Customer Reorder plugin is based on two processes:
- reorder processing
- reorder eligibility checking
They are both based on Symfony's compiler passes and configured in services.xml
file.
ReorderProcessing and EligibilityChecking are independent processes - once a Reorder
is created using Processors (services tagged as sylius_customer_reorder_plugin.reorder_processor
), the created
entity is passed to Eligibility Checkers (services tagged as sylius_customer_reorder_plugin.eligibility_checker
).
Hence, both processes can be extended separately by adding services that implement ReorderEligibilityChecker
and are tagged as sylius_customer_reorder_plugin.eligibility_checker
or implement ReorderProcessor
and are tagged as
sylius_customer_reorder_plugin.reorder_processor
.
Both Reorder
button layout and action performed on clicking it are defined in
reorder.html.twig
template which is declared in config.yml
file.
What's more, since Order is a Resource, major part of its configuration is placed
in *.yml
files. Without using the plugin, Order had Show
and Pay
actions.
Adding Reorder
action required extending order-related behaviours in config.yml
file.
You can read much more about Resources here: http://docs.sylius.com/en/1.2/components_and_bundles/bundles/SyliusResourceBundle/index.html
Security issues
If you think that you have found a security issue, please do not use the issue tracker and do not post it publicly.
Instead, all security issues must be sent to security@sylius.com
.