{"id":13579254,"url":"https://github.com/Brille24/SyliusTierpricePlugin","last_synced_at":"2025-04-05T20:33:31.870Z","repository":{"id":28296956,"uuid":"117225272","full_name":"Brille24/SyliusTierpricePlugin","owner":"Brille24","description":"A plugin for Sylius that implements tier pricing","archived":false,"fork":false,"pushed_at":"2024-04-24T10:30:58.000Z","size":1007,"stargazers_count":44,"open_issues_count":6,"forks_count":36,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-24T15:17:30.007Z","etag":null,"topics":["price","product-variant","sylius","tier-prices","variants"],"latest_commit_sha":null,"homepage":null,"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/Brille24.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-01-12T10:02:57.000Z","updated_at":"2024-06-19T20:02:07.281Z","dependencies_parsed_at":"2024-04-24T11:45:07.364Z","dependency_job_id":null,"html_url":"https://github.com/Brille24/SyliusTierpricePlugin","commit_stats":{"total_commits":350,"total_committers":32,"mean_commits":10.9375,"dds":0.72,"last_synced_commit":"ffe9f3f2ee84e160e888ba3eda2121dc54c88797"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brille24%2FSyliusTierpricePlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brille24%2FSyliusTierpricePlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brille24%2FSyliusTierpricePlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brille24%2FSyliusTierpricePlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brille24","download_url":"https://codeload.github.com/Brille24/SyliusTierpricePlugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399874,"owners_count":20932876,"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":["price","product-variant","sylius","tier-prices","variants"],"created_at":"2024-08-01T15:01:37.756Z","updated_at":"2025-04-05T20:33:26.860Z","avatar_url":"https://github.com/Brille24.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://sylius.com/plugins/\" target=\"_blank\"\u003e\u003cimg src=\"https://sylius.com/assets/badge-approved-by-sylius.png\" width=\"100\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n# Sylius Tier Price Plugin\n[![Build Status](https://travis-ci.org/Brille24/SyliusTierpricePlugin.svg?branch=master)](https://travis-ci.org/Brille24/SyliusTierpricePlugin)\n\nThis plugin adds tier pricing to Sylius one product has different prices based on the quantity.\n\n## Installation\n* Install the bundle via composer `composer require brille24/sylius-tierprice-plugin`\n* Register the bundle in your `bundles.php`:\n```php\nreturn [\n    //...\n\n    Brille24\\SyliusTierPricePlugin\\Brille24SyliusTierPricePlugin::class =\u003e ['all' =\u003e true],\n];\n```\n\n* Add the `config.yml` to your local `config/config.yml`\n```yml\nimports:\n    ...\n    - { resource: '@Brille24SyliusTierPricePlugin/Resources/config/config.yml'}\n```\n\n* For API functionality add the bundle's `routing.yml` to the local `app/config/routing.yml`\n```yml\n...\nbrille24_tierprice_bundle:\n    resource: '@Brille24SyliusTierPricePlugin/Resources/config/routing.yml'\n```\n\n* Go into your ProductVariant class and add the following trait and add one method call to the constructor\n```php\nclass ProductVariant extends BaseProductVariant implements \\Brille24\\SyliusTierPricePlugin\\Entity\\ProductVariantInterface\n{\n    use \\Brille24\\SyliusTierPricePlugin\\Traits\\TierPriceableTrait;\n\n    public function __construct() {\n        parent::__construct(); // Your contructor here\n\n        $this-\u003einitTierPriceableTrait(); // \"Constructor\" of the trait\n    }\n\n    protected function createTranslation(): ProductVariantTranslationInterface\n    {\n        return new ProductVariantTranslation();\n    }\n}\n````\n\n* Finally update the database, install the assets and update the translations:\n```sh\nbin/console doctrine:schema:update --force\nbin/console assets:install\nbin/console translation:update \u003clocale\u003e --force\n```\n\n### Integration\n* This bundle decorates the `sylius.calculator.product_variant_price` service. If you wish to change that, you could register a [compiler pass](https://symfony.com/doc/current/service_container/compiler_passes.html).\n* This bundle decorates the `sylius.order_processing.order_prices_recalculator` service. If you wish to use your own order processor or change its priority, you could register a [compiler pass](https://symfony.com/doc/current/service_container/compiler_passes.html).\n\n## Usage\nFirst of all you have to set up a product with as many variants as you want. Then in each of these variants you can set the tier pricing based on the channels.\nThe table automatically sorts itself to provide a better overview for all different tiers, you configured.\n\n\u003cimg src=\"images/Backend.png\" /\u003e\n\nIn the frontend the user will see a nice looking table right next to the \"add to cart\" button that shows the discount for the different tiers like so:\n\n\u003cimg src=\"images/Front-End.png\" /\u003e\n\n### Creating data\nYou can easily create the tier prices with fixtures like that.\n```yaml\nsylius_fixtures:\n    suites:\n        my_suite:\n            fixtures:\n                tier_prices:\n                    options:\n                        custom:\n                            - product_variant: \"20125148-54ca-3f05-875f-5524f95aa85b\"\n                              channel: US_WEB\n                              quantity: 10\n                              price: 5\n```\nFor this the products need to be created first and the product variant must also exist.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBrille24%2FSyliusTierpricePlugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBrille24%2FSyliusTierpricePlugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBrille24%2FSyliusTierpricePlugin/lists"}