arobases/sylius-back-in-stock-notification-plugin
Composer 安装命令:
composer require arobases/sylius-back-in-stock-notification-plugin
包简介
Timely inform customers and guest visitors when a product return in stock
README 文档
README
Back in Stock Notification Plugin
Plugin that add the possibility to receive an email notification when a product return in stock
Features
Subscribe to get a Notification when a product return in stock
View your subscriptions in the apposite section of your account
View your client subscriptions in the apposite admin section
Requirements
- PHP
^7.3 - Sylius
^1.8
Installation
-
Run
composer require webgriffe/sylius-back-in-stock-notification-plugin. -
Add the plugin to the
config/bundles.phpfile:Webgriffe\SyliusBackInStockNotificationPlugin\WebgriffeSyliusBackInStockNotificationPlugin::class => ['all' => true],
-
Import the plugin routes by creating a file in
config/routes/webgriffe_sylius_back_in_stock_notification_plugin.yamlwith the follwing content:webgriffe_sylius_back_in_stock_notification_plugin: resource: "@WebgriffeSyliusBackInStockNotificationPlugin/Resources/config/routing.yaml"
-
Import required config in your
config/packages/webgriffe_sylius_back_in_stock_notification_plugin.yamlfile:imports: - { resource: "@WebgriffeSyliusBackInStockNotificationPlugin/Resources/config/app/config.yaml" }
-
Finish the installation by updating the database schema and installing assets:
bin/console doctrine:migrations:diff bin/console doctrine:migrations:migrate bin/console assets:install bin/console sylius:theme:assets:install
Configuration
This module send mail using a Symfony Command. Unfortunately, the command line context does not know about your VirtualHost or domain name. To fix this, you need to configure the “request context”, which is a fancy way of saying that you need to configure your environment so that it knows what URL it should use when generating URLs. For further information you can see Symfony Documentation.
- Edit the
config/services.ymlfile by adding the following content:
parameters: router.request_context.host: example.org router.request_context.scheme: https
- As said early this module provide a command that check the stock of the product. You have to set the command
bin/console webgriffe:back-in-stock-notification:alertin the crontab, once a day is enough:
0 12 * * * <absolute-php-path> <absolute-path-to-sylius-dir>/bin/console webgriffe:back-in-stock-notification:alert
Optional Configuration
If you want to use our Behat defined steps you have to include our Behat class in your autoloader-dev. To achieve this adds the following line to your composer.json:
"autoload-dev": { "psr-4": { "Tests\\Webgriffe\\SyliusBackInStockNotificationPlugin\\": "vendor/webgriffe/sylius-back-in-stock-notification-plugin/tests/" } },
Contributing
To contribute to this plugin clone this repository, create a branch for your feature or bugfix, do your changes and then make sure al tests are passing.
```bash
(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 setup a plugin's database, remember to configure you database credentials in tests/Application/.env and tests/Application/.env.test.
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:
```bash 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 src
Opening Sylius with your plugin
-
Using
testenvironment:(cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load) (cd tests/Application && APP_ENV=test bin/console server:run -d public)
-
Using
devenvironment:(cd tests/Application && APP_ENV=dev bin/console sylius:fixtures:load) (cd tests/Application && APP_ENV=dev bin/console server:run -d public)
License
This plugin is under the MIT license. See the complete license in the LICENSE file.
Credits
Developed by Webgriffe®.
arobases/sylius-back-in-stock-notification-plugin 适用场景与选型建议
arobases/sylius-back-in-stock-notification-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 01 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sylius」 「sylius-plugin」 「arobases-sylius-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 arobases/sylius-back-in-stock-notification-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 arobases/sylius-back-in-stock-notification-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 arobases/sylius-back-in-stock-notification-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
Use price tiers in your Sylius store.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-23



