Skip to content

Commit 9ad3ede

Browse files
committed
fix: memberpress undefined array key
1 parent 68897ad commit 9ad3ede

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

includes/Actions/Memberpress/RecordApiHelper.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,16 @@ public function crateMember($integrationDetails, $finalData)
5555
$allData->user_id = $user->ID;
5656
$allData->product_id = sanitize_key($product_id);
5757

58-
$allData->amount = (float) $finalData['sub_total'];
59-
$allData->tax_amount = (float) $finalData['tax_amount'];
60-
$allData->total = ((float) $finalData['sub_total'] + (float) $finalData['tax_amount']);
61-
$allData->tax_rate = (float) $finalData['taxrate'];
58+
$allData->amount = (float) $finalData['sub_total'] ?? 0;
59+
$allData->tax_amount = (float) $finalData['tax_amount'] ?? 0;
60+
$allData->tax_rate = (float) $finalData['taxrate'] ?? 0;
61+
62+
$allData->total = ($allData->amount + $allData->tax_amount);
6263
$allData->status = sanitize_text_field($statusId);
6364
$allData->gateway = sanitize_text_field($gateway);
6465
$allData->created_at = MeprUtils::ts_to_mysql_date(time());
6566

66-
$expiration_date = $finalData['expiration_date'];
67+
$expiration_date = $finalData['expiration_date'] ?? null;
6768

6869
if (empty($expiration_date)) {
6970
$obj = new MeprProduct(sanitize_key($product_id));

includes/Core/Util/AllTriggersName.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public static function allTriggersName()
4242
'EssentialBlocks' => ['name' => 'Essential Blocks', 'isPro' => true, 'is_active' => false],
4343
'Eventin' => ['name' => 'Eventin', 'isPro' => true, 'is_active' => false],
4444
'EVF' => ['name' => 'Everest Forms', 'isPro' => true, 'is_active' => false],
45+
'FluentAffiliate' => ['name' => 'FluentAffiliate', 'isPro' => true, 'is_active' => false],
4546
'FF' => ['name' => 'Fluent Forms', 'isPro' => true, 'is_active' => false],
4647
'FluentBoards' => ['name' => 'Fluent Boards', 'isPro' => true, 'is_active' => false],
4748
'FluentBooking' => ['name' => 'Fluent Booking', 'isPro' => true, 'is_active' => false],

0 commit comments

Comments
 (0)