akawakaweb/customer-reorder-plugin
Composer 安装命令:
composer require akawakaweb/customer-reorder-plugin
包简介
Sylius plugin that enables order reordering for a customer
README 文档
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 trueor 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.
Contributing : installation
Traditional
-
Run
composer create-project sylius/customer-reorder-plugin ProjectName. -
From the plugin skeleton root directory, run the following commands:
$ (cd tests/Application && yarn install) $ (cd tests/Application && yarn build) $ (cd tests/Application && APP_ENV=test bin/console assets:install public) $ (cd tests/Application && APP_ENV=test bin/console doctrine:database:create) $ (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)
To be able to set up a plugin's database, remember to configure you database credentials in tests/Application/.env and tests/Application/.env.test.
Docker
-
Initialize plugin
make init -
See your browser
open localhost
Usage
Running plugin tests
-
PHPUnit
vendor/bin/phpunit
-
PHPSpec
vendor/bin/phpspec run
-
Behat (non-JS scenarios)
vendor/bin/behat --strict --tags="~@javascript" -
Behat (JS scenarios)
-
Start Headless Chrome:
google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1
- Install SSL certificates (only once needed) and run test application's webserver on
127.0.0.1:8080:
symfony server:ca:install APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon
- Run Behat:
vendor/bin/behat --strict --tags="@javascript" -
Static Analysis
-
Psalm
vendor/bin/psalm
-
PHPStan
vendor/bin/phpstan analyse -c phpstan.neon -l max src/
-
-
Coding Standard
vendor/bin/ecs check
akawakaweb/customer-reorder-plugin 适用场景与选型建议
akawakaweb/customer-reorder-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.68k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 04 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「e-commerce」 「sylius」 「sylius-plugin」 「customer reorder」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 akawakaweb/customer-reorder-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 akawakaweb/customer-reorder-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 akawakaweb/customer-reorder-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Implementation of the Omnibus Directive for Sylius application.
Bulk export of sylius resources
Sylius plugin that integrates Addwish
Setono example plugin for Sylius.
Will translate fragments of text automatically
The bundle for easy using json-rpc api on your project
统计信息
- 总下载量: 2.68k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-18
