Skip to content

Commit

Permalink
always check num_terms
Browse files Browse the repository at this point in the history
  • Loading branch information
mecachisenros committed Nov 27, 2018
1 parent b17dba8 commit 6f0492b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions processors/membership/class-membership-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,8 @@ public function pre_processor( $config, $form, $processid ) {
$form_values['contact_id'] = $transient->contacts->{$this->contact_link};

// renew/extend necessary params
if ( isset( $config['is_renewal'] ) && isset( $is_member['id'] ) ) {
if ( isset( $config['is_renewal'] ) && isset( $is_member['id'] ) )
$form_values['id'] = $is_member['id'];
// at least one term
$form_values['num_terms'] = $this->get_num_terms( $form_values, $price_field_value );
}

$form_values['source'] = isset( $form_values['source'] ) ? $form_values['source'] : $form['name'];

Expand All @@ -151,6 +148,9 @@ public function pre_processor( $config, $form, $processid ) {
unset( $form_values['join_date'], $form_values['start_date'], $form_values['end_date'] );
}

// get num_terms
$form_values['num_terms'] = $this->get_num_terms( $form_values, $price_field_value );

$transient->memberships->{$config['processor_id']}->params = $form_values;

$this->plugin->transient->save( $transient->ID, $transient );
Expand Down

0 comments on commit 6f0492b

Please sign in to comment.