{"id":13594188,"url":"https://github.com/Sylius/AdminOrderCreationPlugin","last_synced_at":"2025-04-09T07:31:02.574Z","repository":{"id":31925605,"uuid":"129885032","full_name":"Sylius/AdminOrderCreationPlugin","owner":"Sylius","description":"Create orders in Sylius as an Administrator","archived":false,"fork":false,"pushed_at":"2024-06-10T11:52:08.000Z","size":884,"stargazers_count":56,"open_issues_count":35,"forks_count":50,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-08-09T22:52:47.520Z","etag":null,"topics":["ecommerce","hacktoberfest","php","sylius","sylius-plugin","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sylius.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-04-17T10:06:27.000Z","updated_at":"2024-06-10T11:52:10.000Z","dependencies_parsed_at":"2023-01-14T20:07:27.977Z","dependency_job_id":"979b92f4-a407-4edb-bd80-7933d7b25259","html_url":"https://github.com/Sylius/AdminOrderCreationPlugin","commit_stats":{"total_commits":308,"total_committers":23,"mean_commits":"13.391304347826088","dds":0.6038961038961039,"last_synced_commit":"430c2de71ce723b1ec7da9bba83c2a35c7399891"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sylius%2FAdminOrderCreationPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sylius%2FAdminOrderCreationPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sylius%2FAdminOrderCreationPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sylius%2FAdminOrderCreationPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sylius","download_url":"https://codeload.github.com/Sylius/AdminOrderCreationPlugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223375195,"owners_count":17135323,"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","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":["ecommerce","hacktoberfest","php","sylius","sylius-plugin","symfony"],"created_at":"2024-08-01T16:01:29.964Z","updated_at":"2024-11-06T16:30:42.837Z","avatar_url":"https://github.com/Sylius.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://sylius.com\" target=\"_blank\"\u003e\n        \u003cpicture\u003e\n          \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://media.sylius.com/sylius-logo-800-dark.png\"\u003e\n          \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://media.sylius.com/sylius-logo-800.png\"\u003e\n          \u003cimg alt=\"Sylius Logo.\" src=\"https://media.sylius.com/sylius-logo-800.png\"\u003e\n        \u003c/picture\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eAdmin Order Creation Plugin\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://sylius.com/plugins/\" target=\"_blank\"\u003e\u003cimg src=\"https://sylius.com/assets/badge-official-sylius-plugin.png\" width=\"200\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eThis plugin allows to create an order in admin panel.\u003c/p\u003e\n\n![Screenshot showing the order creation page, Shipments\u0026Payments section](docs/screenshot.png)\n\n## Business value\n\nSo far it was up to the Customer to place an order using available product variants as well as payment and shipping\nmethods.\n\nThe whole process of placing an order is not that obvious, however. For some reason a Customer may feel a little bit\nconfused when a promotion is no longer available or shipping method is not eligible for given area. Here comes\nAdmin Order Creation Plugin.\n\nBriefly speaking, it allows an Administrator to place or reorder an order in the name of a Customer. It helps them solve\neven more of Customers' fundamental problems and equips an Administrator with basic tools making creating an \norder possible.\n\nAdmin Order Creation Plugin processes are strongly based on standard Order model taken from SyliusCoreBundle.\nThe only things that differ are order creation context and business requirements. Right now it is up to the Administrator\nto provide a channel, locale and currency in which an Order is created. What's more, the Administrator is able to add\na discount for any item or the whole Order, which is, technically speaking, a new type of Sylius Adjustments.\n\nAfter creating an Order via Admin panel, this new Order is listed like any other order placed via Sylius.\n\n## Installation\n\n#### Beware!\n\n\u003e This installation instruction assumes that you're using Symfony Flex. If you don't, take a look at the\n[legacy installation instruction](docs/legacy_installation.md). However, we strongly encourage you to use\nSymfony Flex, it's much quicker! :)\n\n1. Require plugin with composer:\n\n    ```bash\n    composer require sylius/admin-order-creation-plugin\n    ```\n    \n    \u003e Remember to allow community recipes with `composer config extra.symfony.allow-contrib true` or during plugin installation process\n\n2. Copy Sylius templates overridden in plugin to your templates directory (e.g `templates/bundles/`):\n\n    ```bash\n    mkdir -p templates/bundles/SyliusAdminBundle/\n    cp -R vendor/sylius/admin-order-creation-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/\n    ```\n\n3. Override repositories\n\n   1. Create repository classes\n      ```bash\n      mkdir src/Repository\n      touch src/Repository/CustomerRepository.php\n      touch src/Repository/ProductVariantRepository.php\n      ```\n   2. Paste the following content to the `src/Repository/CustomerRepository.php`:\n      ```php\n      \u003c?php\n    \n      declare(strict_types=1);\n    \n      namespace App\\Repository;\n      \n      use Sylius\\AdminOrderCreationPlugin\\Doctrine\\ORM\\CustomerRepositoryInterface;\n      use Sylius\\AdminOrderCreationPlugin\\Doctrine\\ORM\\CustomerRepositoryTrait;\n      use Sylius\\Bundle\\CoreBundle\\Doctrine\\ORM\\CustomerRepository as BaseCustomerRepository;\n      \n      final class CustomerRepository extends BaseCustomerRepository implements CustomerRepositoryInterface\n      {\n          use CustomerRepositoryTrait;\n      }\n      ```\n   3. Paste the following content to the `src/Repository/ProductVariantRepository.php`:\n      ```php\n      \u003c?php\n    \n      declare(strict_types=1);\n    \n      namespace App\\Repository;\n\n      use Sylius\\AdminOrderCreationPlugin\\Doctrine\\ORM\\ProductVariantRepositoryInterface;\n      use Sylius\\AdminOrderCreationPlugin\\Doctrine\\ORM\\ProductVariantRepositoryTrait;\n      use Sylius\\Bundle\\CoreBundle\\Doctrine\\ORM\\ProductVariantRepository as BaseProductVariantRepository;\n      \n      final class ProductVariantRepository extends BaseProductVariantRepository implements ProductVariantRepositoryInterface\n      {\n          use ProductVariantRepositoryTrait;\n      }\n      ```\n   4. Configure repositories in `config/packages/_sylius.yaml`:\n   ```diff\n    sylius_customer:\n        resources:\n            customer:\n                classes:\n                    model: App\\Entity\\Customer\\Customer\n   +                repository: App\\Repository\\CustomerRepository\n   \n    sylius_product:\n        resources:\n            product_variant:\n                classes:\n                    model: App\\Entity\\Product\\ProductVariant\n   +                repository: App\\Repository\\ProductVariantRepository\n   ```\n      \n\n## Extension points\n\nAdmin Order Creation Plugin makes it possible to add custom discount during order creation - thus some of Order\nShow templates need to be replaced with those placed in `Resources/views` package.\n\nPayment link generation and sending process is based on logic placed in the PaymentLinkCreationListener class. Thus, it can\nbe easily replaced with suitable implementation.\n\nAdjustments set is not closed and strictly defined - adding custom adjustment means defining a new constant in the\nAdjustmentType class.\n\nSignificant part of Reorder Processing is inspired by official Sylius \n[Customer Reorder Plugin](https://github.com/Sylius/CustomerReorderPlugin/). In case of the need for more processors,\njust add new class implementing `ReorderProcessor` interface, declare it in `reorder_processing.xml` file and match\nit with a proper tag.\n\nAdmin Order Creation process is based on Symfony Forms. To find out more about Symfony Forms extension possibilities, check out\n[Symfony Docs](https://symfony.com/doc/current/form/create_form_type_extension.html).   \n\n## Security issues\n\nIf you think that you have found a security issue, please do not use the issue tracker and do not post it publicly. \nInstead, all security issues must be sent to `security@sylius.com`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSylius%2FAdminOrderCreationPlugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSylius%2FAdminOrderCreationPlugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSylius%2FAdminOrderCreationPlugin/lists"}