Skip to content

Adds a ribbon to product cards and the product image on the details page, to clarify that products are out of stock.

Notifications You must be signed in to change notification settings

nedac-sorbo/SyliusTemporarilyOutOfStockPlugin

Repository files navigation

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

About

Adds a ribbon to product cards and the product image on the details page, to clarify that products are out of stock.

Resources

Stars

Watchers

Forks

Packages