Plugin to make products archivable when they shouldn't be available anymore. Also includes the option to archive products automatically when they reach a stock of 0 on all variants.
- Require plugin via Composer
composer require vaachar/sylius-archivable-products-plugin
- Inlcude config.yaml in
_sylius.yaml
- { resource: "@SyliusArchivableProductsPlugin/Resources/config/config.yaml" }
- Use trait and add interface to
src/Entity/Product/Product.php
class Product extends BaseProduct implements IsArchivableProductInterface
{
use ArchivableProductTrait;
...
}
- Execute migrations
bin/console doctrine:migrations:migrate
This plugin adds a new menu entry to the side menu when creating or editing a product called Archive
.
There you can activate the Archive when out of stock
option to let this plugin automatically disable a product and archive it. You can also manually enter a date/time to archive the product there.
On the admin product listing page you can also quickly archive a product via the Archive
action button.
Archiving a product will hide it from the admin product listing so that your shop administrators can easily identify if a disabled product is only temporarily disabled or if it is archived and thus discontinued. You can view all archived products by selecting the respective filter.