Search code examples
shopwareshopware6

How to find fully paid orders in Shopware 6? (are partial payments possible?)


What is the right way to find full-paid orders in Shopware 6?

We are using this code:

$criteria = new Criteria();
$criteria->addFilter(new EqualsFilter('transactions.stateMachineState.technical_name', 'paid'));

...

$this->orderRepository->search($criteria, $context)->getEntities()

This seems to work in general. But what if an order has multiple transactions? I believe this would find still partially paid transactions.

Can an orders even have multiple transactions? How would that case be created in the frontend?


Solution

  • There is a status called paid_partially, so they would not be part of the paid status. Partial payment are possible, just like partial shipping & refunding. However, as far as I know, on the frontend, there is no default payment method that can do partial payments. You will need to find a suitable plugin for this to work on the frontend.