setono/sylius-bulk-edit-plugin

Setono example plugin for Sylius.

Fund package maintenance!
Setono

Installs: 16 013

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 3

Forks: 2

Open Issues: 1

Type:symfony-bundle

v0.3.2 2023-09-18 10:44 UTC

This package is auto-updated.

Last update: 2024-11-18 16:51:55 UTC


README

Latest Version Latest Unstable Version Software License Build Status Code Coverage

This plugin is a proof of concept of something great to be.

Installation

Download

$ composer require setono/sylius-bulk-edit-plugin

Import configuration

# config/packages/setono_sylius_bulk_edit.yaml
imports:
    # ...
    - { resource: "@SetonoSyliusBulkEditPlugin/Resources/config/app/config.yaml" }

Import routes

# config/routes/setono_sylius_bulk_edit.yaml
setono_sylius_bulk_edit:
    resource: "@SetonoSyliusBulkEditPlugin/Resources/config/routes.yaml"

or if your app doesn't use locales:

# config/routes.yaml
setono_sylius_bulk_edit:
    resource: "@SetonoSyliusBulkEditPlugin/Resources/config/routes_no_locale.yaml"

Add plugin class to your bundles.php:

<?php
$bundles = [
    // ...

    Setono\SyliusBulkEditPlugin\SetonoSyliusBulkEditPlugin::class => ['all' => true],

    // ...
];

Extend resource classes

Extend ProductRepository

<?php

# src/Doctrine/ORM/ProductRepository.php

declare(strict_types=1);

namespace App\Doctrine\ORM;

use Setono\SyliusBulkEditPlugin\Doctrine\ORM\ProductRepositoryTrait;
use Setono\SyliusBulkEditPlugin\Repository\ProductRepositoryInterface;
use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository as BaseProductRepository;

class ProductRepository extends BaseProductRepository implements ProductRepositoryInterface
{
    use ProductRepositoryTrait;
}

Add configuration

# config/packages/_sylius.yaml
sylius_product:
    resources:
        product:
            classes:
                repository: App\Doctrine\ORM\ProductRepository

Done!

Go to /admin/products, select a few products and click the Edit button.