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

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

1.1.0 2021-09-08 09:18 UTC

This package is auto-updated.

Last update: 2021-09-08 09:21:10 UTC


README

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