Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Issue #238 Membership Discount not applied. #200

Merged
merged 2 commits into from Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions cividiscount.php
Expand Up @@ -592,6 +592,14 @@ function cividiscount_civicrm_membershipTypeValues(&$form, &$membershipTypeValue
list($value, $label) = _cividiscount_calc_discount($values['minimum_fee'], $values['name'], $discount, $discountCalculator->isAutoDiscount());
$values['minimum_fee'] = $value;
$values['name'] = $label;

// set total amount to be same as the calculated discount
// this will overwrite the submitted total amount
if (!empty($form->_submitValues['membership_type_id'])) {
if ($values['member_of_contact_id'] == $form->_submitValues['membership_type_id'][0] && $values['id'] == $form->_submitValues['membership_type_id'][1]) {
$form->_submitValues['total_amount'] = $value;
}
}
}
}

Expand Down