{"id":25564687,"url":"https://github.com/asdoria/asdoriasyliusproductdocumentplugin","last_synced_at":"2025-04-12T10:09:52.339Z","repository":{"id":37777382,"uuid":"459594792","full_name":"asdoria/AsdoriaSyliusProductDocumentPlugin","owner":"asdoria","description":"Manage The Product Documents  ","archived":false,"fork":false,"pushed_at":"2023-03-14T10:55:26.000Z","size":1903,"stargazers_count":9,"open_issues_count":1,"forks_count":6,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-12T10:09:40.763Z","etag":null,"topics":["document","ecommerce","php","product-file","sylius","sylius-plugin"],"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/asdoria.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":null,"security":null,"support":null}},"created_at":"2022-02-15T13:40:07.000Z","updated_at":"2024-01-01T19:14:42.000Z","dependencies_parsed_at":"2023-01-31T07:00:54.884Z","dependency_job_id":null,"html_url":"https://github.com/asdoria/AsdoriaSyliusProductDocumentPlugin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdoria%2FAsdoriaSyliusProductDocumentPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdoria%2FAsdoriaSyliusProductDocumentPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdoria%2FAsdoriaSyliusProductDocumentPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdoria%2FAsdoriaSyliusProductDocumentPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asdoria","download_url":"https://codeload.github.com/asdoria/AsdoriaSyliusProductDocumentPlugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550634,"owners_count":21122933,"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":["document","ecommerce","php","product-file","sylius","sylius-plugin"],"created_at":"2025-02-20T21:59:27.793Z","updated_at":"2025-04-12T10:09:52.294Z","avatar_url":"https://github.com/asdoria.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003c/p\u003e\n\n![Example of a product's documents customization](doc/asdoria.jpg)\n\n\u003ch1 align=\"center\"\u003eAsdoria Product Document Plugin\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA plugin to create, group and associate documents with products\u003c/p\u003e\n\n## Features\n\n+ Create type of documents \n+ Easily customize which documents to display from the product configuration page\n+ Document are automatically displayed on the product's store page and downloaded there\n\n\u003cdiv style=\"max-width: 75%; height: auto; margin: auto\"\u003e\n\n![Example of a product's documents customization](doc/front.png)\n\n\u003c/div\u003e\n\n\n\u003cdiv style=\"max-width: 75%; height: auto; margin: auto\"\u003e\n\nCreating a document type and customizing its content in the product edit page.\n![Example of a product's documents customization](doc/document.gif)\n\n\u003c/div\u003e\n\n## Installation\n\n1. run `composer require asdoria/sylius-product-document-plugin`\n\n2. Add the bundle in `config/bundles.php`. You must put it ABOVE `SyliusGridBundle`\n\n```PHP\nAsdoria\\SyliusProductDocumentPlugin\\AsdoriaSyliusProductDocumentPlugin::class =\u003e ['all' =\u003e true],\n[...]\nSylius\\Bundle\\GridBundle\\SyliusGridBundle::class =\u003e ['all' =\u003e true],\n```\n\n3. Import routes in `config/routes.yaml`\n\n```yaml\nasdoria_product_document:\n    resource: \"@AsdoriaSyliusProductDocumentPlugin/Resources/config/routing.yaml\"\n```\n\n4. Import config in `config/packages/_sylius.yaml`\n```yaml\nimports:\n    - { resource: \"@AsdoriaSyliusProductDocumentPlugin/Resources/config/app/config.yaml\"}\n```\n5. In `src/Entity/Product/Product.php`. Import the following classes, traits and methods.\n\n```PHP\nuse Asdoria\\SyliusProductDocumentPlugin\\Model\\Aware\\ProductDocumentsAwareInterface;\nuse Asdoria\\SyliusProductDocumentPlugin\\Model\\ProductDocumentInterface;\nuse Asdoria\\SyliusProductDocumentPlugin\\Traits\\ProductDocumentsTrait;\nuse Sylius\\Component\\Product\\Model\\ProductTranslationInterface;\n\nclass Product extends BaseProduct implements  ProductDocumentsAwareInterface\n{\n    use ProductDocumentsTrait;\n\n    public function __construct()\n    {\n        parent::__construct();\n        $this-\u003einitializeProductDocumentsCollection();\n    }\n    \n    /**\n     * @param ProductDocumentInterface $productDocument\n     */\n    public function addProductDocument(ProductDocumentInterface $productDocument): void\n    {\n        if (!$this-\u003ehasProductDocument($productDocument)) {\n            $productDocument-\u003esetProduct($this);\n            $this-\u003eproductDocuments-\u003eadd($productDocument);\n        }\n    }\n\n    /**\n     * @param ProductDocumentInterface $productDocument\n     */\n    public function removeProductDocument(ProductDocumentInterface $productDocument): void\n    {\n        if ($this-\u003ehasProductDocument($productDocument)) {\n            $productDocument-\u003esetProduct(null);\n            $this-\u003eproductDocuments-\u003eremoveElement($productDocument);\n        }\n    }    \n}\n```\n6. run `php bin/console do:mi:mi` to update the database schema`\n\n7. Gaufrette is no longer used by Sylius in favour of Flysystem. If you want to use Gaufrette in your project, you need\n    to set:\n\n    ```yaml\n    asdoria_sylius_product_document:\n        filesystem:\n            adapter: gaufrette\n    ```\n    \n    in your `config/packages/_sylius.yaml` file.\n\n## Demo\n\nYou can see the result for the user here with a cap: [here](https://demo-sylius.asdoria.fr/en_US/products/knitted-wool-blend-green-cap). \u003cbr\u003e\nIf you want to try to create documents, go on [the admin authentication page](https://demo-sylius.asdoria.fr/admin/) and connect with:\n\u003e **Login:** asdoria \u003cbr\u003e\n\u003e **Password:** asdoria\n\u003e \nThen go on [\"Document Type\" in the back office](https://demo-sylius.asdoria.fr/admin/document-types/) and follow usage lines below.\n\nNote that we have developed several other open source plugins for Sylius, whose demos and documentation are listed on the [following page](https://asdoria.github.io/).\n\n## Usage\n\n1. In the back office, under `Catalog`, enter `Document Types`. Create a type of document using a unique code. \n2. Go to a product's edit page, then click the `Documents` tab in the sidebar. Here you can add documents type then upload which document you wish to display for each.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasdoria%2Fasdoriasyliusproductdocumentplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasdoria%2Fasdoriasyliusproductdocumentplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasdoria%2Fasdoriasyliusproductdocumentplugin/lists"}