Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PIWOO-424] Payment Status column displayed in orders overview when capturing payments immediately #881

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MerchantCapture/MerchantCaptureModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,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 Automattic\WooCommerce\Admin\Overrides\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
Loading