Adds a "origin" field to your product entity and a filter to the frontend.
- Add the "repositories" key to to composer.json
"repositories": [
{
"type": "vcs",
"url": "git@github.com:ecolos-de/sylius-origin-plugin.git"
}
],
- Install package from Github via terminal
composer require ecolos/sylius-origin-plugin
- add to config/bundles.php
Ecolos\SyliusOriginPlugin\EcolosSyliusOriginPlugin::class => ['all' => true],
- Add to config/packages/_sylius.yml
- { resource: "@EcolosSyliusOriginPlugin/Resources/config/_sylius.yml" }
- Add to config/services.yml
- { resource: "@EcolosSyliusOriginPlugin/Resources/config/services.yml" }
- Add to src/Entity/Product.php
use Ecolos\SyliusOriginPlugin\Entity\OriginTrait;
class Product extends BaseProduct implements ProductInterface
{
use EuTrait, MakerTrait, OriginTrait, SeoTrait;
}
- Update doctrine changes
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:execute --up XXXXXXXXXXX
- Write tests