Commit dc61a7f4 authored by Allan Chappell's avatar Allan Chappell
Browse files

[#74] Tracking discount codes used on memberships with pricesets.

parent de3e8d21
......@@ -557,8 +557,12 @@ function cividiscount_civicrm_postProcess($class, &$form) {
$membership_type = $params['selectMembership'];
$membershipId = $params['membershipID'];
if (!is_array($membership_type)) {
$membership_type = array($membership_type);
}
$discount_membership_matches = array_intersect($membership_type, $discount['memberships']);
// check to make sure the discount actually applied to this membership.
if (!CRM_Utils_Array::value($membership_type, $discount['memberships']) || !$membershipId) {
if ( empty($discount_membership_matches) || !$membershipId) {
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment