nedac/sylius-temporarily-out-of-stock-plugin

Sylius plugin that adds a ribbon to product images of products that are out of stock.


Keywords
sylius, sylius-plugin
License
MIT

Documentation

This plugin adds a ribbon clarifying that a product is out of stock to the product cards and main image on the product detail page.

Product Card Product Detail

Supported Sylius versions:
1.10

NOTE: This plugin requires PHP 7.4 or up

Installation:

  1. Install using composer:

    composer require nedac/sylius-temporarily-out-of-stock-plugin
  2. If the ProductRepository is overridden in the project, then make sure it uses the trait:

    <?php
    
    # src/Repository/ProductRepository.php
    
    declare(strict_types=1);
    
    namespace App\Repository;
    
    use Nedac\SyliusTemporarilyOutOfStockPlugin\Repository\ProductRepositoryTrait;
    use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository as BaseProductRepository;
    
    final class ProductRepository extends BaseProductRepository {
       use ProductRepositoryTrait;
    }

    If the ProductRepository is not overridden in the project, please use the repository of this plugin:

    # config/packages/_sylius.yaml
    
    # ...
    
    sylius_product:
        resources:
            product:
                classes:
                    repository: Nedac\SyliusTemporarilyOutOfStockPlugin\Repository\ProductRepository
    
    # ...
  3. Install assets:

    bin/console sylius:install:assets