Skip to content

Commit

Permalink
Merge pull request #881 from mollie/fix/PIWOO-424
Browse files Browse the repository at this point in the history
[PIWOO-424] Payment Status column displayed in orders overview when capturing payments immediately
  • Loading branch information
mmaymo authored Sep 25, 2024
2 parents c6e10f6 + af2cdc4 commit a0f5f57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/MerchantCapture/MerchantCaptureModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static function ($disableShipAndCapture, WC_Order $order) use ($container) {
10,
2
);
new OrderListPaymentColumn();
new OrderListPaymentColumn($container);
new ManualCapture($container);
new StateChangeCapture($container);
});
Expand Down
10 changes: 9 additions & 1 deletion src/MerchantCapture/OrderListPaymentColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@

use WC_Order;
use Mollie\WooCommerce\MerchantCapture\UI\StatusRenderer;
use Mollie\WooCommerce\Vendor\Psr\Container\ContainerInterface;

class OrderListPaymentColumn
{
public function __construct()
/** @var ContainerInterface $container */
private $container;
public function __construct($container)
{
$this->container = $container;
add_filter('manage_edit-shop_order_columns', [$this, 'renderColumn']);
add_action('manage_shop_order_posts_custom_column', [$this, 'renderColumnValue'], 10, 2);

Expand All @@ -23,6 +27,10 @@ public function __construct()

public function renderColumn(array $columns): array
{
if (!$this->container->get('merchant.manual_capture.enabled')) {
return $columns;
}

$newColumns = [];
$mollieColumnAdded = false;

Expand Down

0 comments on commit a0f5f57

Please sign in to comment.