[Bug] Document how to properly extend possible refunds
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 73
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Description
SyliusRefundPlugin version affected: na
Description
I use another type of adjustment as "fees", I need to be able to refund it. So far I'm overriding the orderRefunds.html.twig file and add refund type to the Enum but it's not smooth or documentated.
My type is not found in my own refundType implementation
<?php
declare(strict_types=1);
namespace App\Refund\SyliusRefundPlugin\Model;
use Sylius\RefundPlugin\Model\RefundType as BaseRefundType;
use Sylius\RefundPlugin\Model\RefundTypeInterface;
class RefundType extends BaseRefundType implements RefundTypeInterface
{
public const ORDER_FEES = 'commission';
public static function commission(): self
{
return new self(self::ORDER_FEES);
}
}
An exception has been thrown during the rendering of a template ("Value 'commission' is not part of the enum Sylius\RefundPlugin\Model\RefundType").
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the custom RefundType implementation, the base RefundType enum, and the overridden orderRefunds.html.twig mentioned in the report. Document the supported extension steps for adding a refund type such as commission, including how to prevent the enum rendering error; done means a user can follow the guidance without relying on an undocumented template override.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100