{"id":24780407,"url":"https://github.com/webgriffe/syliusbackinstocknotificationplugin","last_synced_at":"2025-10-12T04:31:17.648Z","repository":{"id":40367283,"uuid":"338376060","full_name":"webgriffe/SyliusBackInStockNotificationPlugin","owner":"webgriffe","description":"A plugin that adds the possibility to receive an email notification when a product is returned in stock.","archived":false,"fork":false,"pushed_at":"2024-10-15T14:23:14.000Z","size":3138,"stargazers_count":5,"open_issues_count":3,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-06T12:51:27.476Z","etag":null,"topics":["php","sylius","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webgriffe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-12T16:45:13.000Z","updated_at":"2024-10-15T14:23:19.000Z","dependencies_parsed_at":"2023-11-28T15:44:40.006Z","dependency_job_id":"2962cebd-f082-468d-bd2d-d757e49e99e9","html_url":"https://github.com/webgriffe/SyliusBackInStockNotificationPlugin","commit_stats":{"total_commits":99,"total_committers":4,"mean_commits":24.75,"dds":0.101010101010101,"last_synced_commit":"9f301283f1ad85ef32460b9bffba19683c2d10b1"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/webgriffe/SyliusBackInStockNotificationPlugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webgriffe%2FSyliusBackInStockNotificationPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webgriffe%2FSyliusBackInStockNotificationPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webgriffe%2FSyliusBackInStockNotificationPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webgriffe%2FSyliusBackInStockNotificationPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webgriffe","download_url":"https://codeload.github.com/webgriffe/SyliusBackInStockNotificationPlugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webgriffe%2FSyliusBackInStockNotificationPlugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010259,"owners_count":26084719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","sylius","symfony"],"created_at":"2025-01-29T10:30:23.591Z","updated_at":"2025-10-12T04:31:17.100Z","avatar_url":"https://github.com/webgriffe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://sylius.com\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://demo.sylius.com/assets/shop/img/logo.png\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eBack in Stock Notification Plugin\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003ePlugin that add the possibility to receive an email notification when a product return in stock\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/webgriffe/SyliusBackInStockNotificationPlugin/actions\"\u003e\u003cimg src=\"https://github.com/webgriffe/SyliusBackInStockNotificationPlugin/workflows/Build/badge.svg\" alt=\"Build Status\" /\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Features\n\n### Subscribe to get a Notification when a product return in stock\n\n![Subscription process for configurable product](subscriprion_process.gif)\n\n![Subscription for simple product](simple_product.png)\n\n### View your subscriptions in the apposite section of your account\n\n![See the apposite section in the my account](my_account_section.png)\n\n### View your client subscriptions in the apposite admin section\n\n![See the apposite section in the admin account](admin_account_section.png)\n\n## Requirements\n\n* PHP `^8.0`\n* Sylius `^1.11.2`\n\n## Installation\n\n1. Run `composer require webgriffe/sylius-back-in-stock-notification-plugin --no-scripts`.\n\n2. Add the plugin to the `config/bundles.php` file:\n\n```php\nWebgriffe\\SyliusBackInStockNotificationPlugin\\WebgriffeSyliusBackInStockNotificationPlugin::class =\u003e ['all' =\u003e true],\n```\n\n3. Import the plugin routes by creating a file in `config/routes/webgriffe_sylius_back_in_stock_notification_plugin.yaml` with the follwing content:\n\n```yaml\nwebgriffe_sylius_back_in_stock_notification_plugin:\n  resource: \"@WebgriffeSyliusBackInStockNotificationPlugin/config/routing.yaml\"\n```\n\n4. Import required packages config in your `config/packages/webgriffe_sylius_back_in_stock_notification_plugin.yaml` file:\n\n```yaml\nimports:\n   - { resource: \"@WebgriffeSyliusBackInStockNotificationPlugin/config/packages.yaml\" }\n```\n\n5. Update the database schema and install assets:\n\n```bash\nbin/console doctrine:migrations:migrate\nbin/console assets:install\nbin/console sylius:theme:assets:install\n```\n\n6. Install the plugin JS assets by adding the source to your webpack configuration:\n\n```js\n// Shop config\nEncore.setOutputPath('public/build/shop/')\n    .setPublicPath('/build/shop')\n    .addEntry('shop-entry', './vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/private/entry.js')\n    .addEntry('webgriffe-sylius-back-in-stock-notification-entry', './vendor/webgriffe/sylius-back-in-stock-notification-plugin/public/js/back-in-stock-notification.js') // The line to add\n    .disableSingleRuntimeChunk()\n    .cleanupOutputBeforeBuild()\n    .enableSourceMaps(!Encore.isProduction())\n    .enableVersioning(Encore.isProduction())\n    .enablePostCssLoader()\n    .enableSassLoader()\n```\n\n7. Run yarn build:\n\n```bash\nbin/console yarn:build\n```\n\n8. Clear cache:\n\n```bash\nbin/console cache:clear\n```\n\n## Configuration\n\nThis module sends mail using a Symfony Command. Unfortunately, the command line context does not know about your VirtualHost or domain name. To fix this, the Command loads the hostname from the Subscription's channel, if nothing set it defaults to `localhost`. In console commands, URLs use http by default. You can change this globally with these configuration parameters:\n\n1. Edit the `config/services.yml` file by adding the following content:\n\n```yaml\nparameters:\n    router.request_context.scheme: https\n```\n\n2. As said early this module provides a command that check the stock of the product. You have to set the command `bin/console webgriffe:back-in-stock-notification:alert` in the crontab, once a day is enough:\n\n```bash\n0 12 * * * \u003cabsolute-php-path\u003e \u003cabsolute-path-to-sylius-dir\u003e/bin/console webgriffe:back-in-stock-notification:alert\n```\n\n## Optional Configuration\n\nIf 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`:\n\n```json\n\"autoload-dev\": {\n    \"psr-4\": {\n      \"Tests\\\\Webgriffe\\\\SyliusBackInStockNotificationPlugin\\\\\": \"vendor/webgriffe/sylius-back-in-stock-notification-plugin/tests/\"\n    }\n},\n```\n\n## Contributing\n\nTo 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.\n\n```bash\ncomposer install\n(cd tests/Application \u0026\u0026 yarn install)\n(cd tests/Application \u0026\u0026 yarn build)\n(cd tests/Application \u0026\u0026 APP_ENV=test bin/console assets:install public)\n\ndocker-compose up -d # only if you haven't mysql and mailhog installed locally \n\n(cd tests/Application \u0026\u0026 APP_ENV=test bin/console doctrine:database:create)\n(cd tests/Application \u0026\u0026 APP_ENV=test bin/console doctrine:schema:create)\n```\n\nTo be able to setup a plugin's database, remember to configure you database credentials in `tests/Application/.env` and `tests/Application/.env.test`.\n\n### Running plugin tests\n\n#### PHPUnit\n\n```bash\nvendor/bin/phpunit\n```\n\n#### PHPSpec\n\n```bash\nvendor/bin/phpspec run\n```\n\n#### Behat (non-JS scenarios)\n\n```bash\nvendor/bin/behat --strict --tags=\"~@javascript\"\n```\n\n#### Behat (JS scenarios)\n\n1. [Install Symfony CLI command](https://symfony.com/download).\n    \n2. Start Headless Chrome:\n\n```bash\ngoogle-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\n```\n\n3. Install SSL certificates (only once needed) and run test application's webserver on `127.0.0.1:8080`:\n\n```bash\nsymfony server:ca:install\nAPP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon\n```\n\n4. Run Behat:\n\n```bash\nvendor/bin/behat --strict --tags=\"@javascript\"\n```\n  \n#### Static Analysis\n\n##### Psalm\n\n```bash\nvendor/bin/psalm\n```\n\n##### PHPStan\n\n```bash\nvendor/bin/phpstan analyse -c phpstan.neon\n```\n\n##### Coding Standard\n\n```bash\nvendor/bin/ecs check\n```\n\n### Opening Sylius with your plugin\n\n- Using `test` environment:\n\n```bash\n(cd tests/Application \u0026\u0026 APP_ENV=test bin/console sylius:fixtures:load)\nAPP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon\n```\n\n- Using `dev` environment:\n\n```bash\n(cd tests/Application \u0026\u0026 APP_ENV=dev bin/console sylius:fixtures:load)\nAPP_ENV=dev symfony server:start --dir=tests/Application/public --daemon\n```\n\n## License\n\nThis plugin is under the MIT license. See the complete license in the LICENSE file.\n\n## Credits\n\nDeveloped by [Webgriffe®](http://www.webgriffe.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebgriffe%2Fsyliusbackinstocknotificationplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebgriffe%2Fsyliusbackinstocknotificationplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebgriffe%2Fsyliusbackinstocknotificationplugin/lists"}