Manual Installation

1. Require the plugin

Add the package via Composer:

composer require sylius/refund-plugin

2. Register bundles

In your config/bundles.php, register both the Snappy PDF bundle and the Refund Plugin:

return [
    Knp\Bundle\SnappyBundle\KnpSnappyBundle::class => ['all' => true],
    Sylius\RefundPlugin\SyliusRefundPlugin::class => ['all' => true],
];

3. Import plugin configuration

In your main config (e.g. config/packages.yaml), add:

imports:
    - { resource: '@SyliusRefundPlugin/config/config.yaml' }

4. Import routes

In your routing configuration:

sylius_refund:
    resource: '@SyliusRefundPlugin/config/routes.yaml'

Ensure it’s loaded with your other plugin routes.

5. Run migrations

bin/console doctrine:migrations:migrate

This will create the necessary refund tables in the database.

6. Include admin assets

Open assets/admin/entrypoint.js (or wherever your admin JS entry is), and import the refund plugin’s entrypoint:

import '../../vendor/sylius/refund-plugin/assets/entrypoint';

7. Build frontend assets

Recompile your admin UI:

yarn encore dev

Or, for production:

yarn encore production

8. Configure wkhtmltopdf

If wkhtmltopdf is not in a default location, set:

WKHTMLTOPDF_PATH=/path/to/wkhtmltopdf

This ensures the plugin can find the binary at runtime.

9. Clear cache

bin/console cache:clear

Last updated

Was this helpful?