PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.18.0.1 4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 All 258 releases
← All changes | src/Donations/ListTable/Columns/StatusColumn.php +11 -3 2.30.0 → 4.16.9 View file →
@@ -4,8 +4,9 @@
4 4
5 5 namespace Give\Donations\ListTable\Columns;
6 6
7 7 use Give\Donations\Models\Donation;
8 +use Give\Donations\ValueObjects\DonationStatus;
8 9 use Give\Framework\ListTable\ModelColumn;
9 10
10 11 /**
11 12 * @since 2.24.0
@@ -36,8 +37,9 @@
36 37 return __('Status', 'give');
37 38 }
38 39
39 40 /**
41 + * @since 4.8.0 Updated status to complete if subscription renewal
40 42 * @since 2.24.0
41 43 *
42 44 * @inheritDoc
43 45 *
@@ -44,11 +46,17 @@
44 46 * @param Donation $model
45 47 */
46 48 public function getCellValue($model): string
47 49 {
50 + $status = $model->status;
51 +
52 + if (isset($_REQUEST['subscriptionId']) && $model->type->isRenewal() && $model->status->isRenewal()) {
53 + $status = DonationStatus::COMPLETE();
54 + }
55 +
48 56 return sprintf(
49 - '<div class="statusBadge statusBadge--%1$s"><p>%2$s</p></div>',
50 - $model->status->getValue(),
51 - $model->status->label()
57 + '<div class="statusBadge statusBadge--%1$s"><p>%2$s</p></div>',
58 + $status->getValue(),
59 + $status->label()
52 60 );
53 61 }
54 62 }