BASW-131: Membership end date rules#6
Conversation
| 'value' => 0, | ||
| 'exposed_empty_option' => t('Automatic'), | ||
| ); | ||
| $fields['membership_start_date_memberships'] = array ( |
There was a problem hiding this comment.
maybe membership_start_date_rules_memberships is more clear, same for end_date_rules
| 'expose_list' => TRUE, | ||
| 'extra' => array('multiple' => 1), | ||
| ); | ||
| $fields['membership_pro_rate_membership'] = array( |
There was a problem hiding this comment.
since this field is not related to the commit, it should not be here, and while it is fine for this PR, I think it is important to not do that when you open the PR against webform_civicrm core repo.
| 'expose_list' => TRUE, | ||
| 'extra' => array('multiple' => 1), | ||
| ); | ||
| $fields['membership_pro_rate_membership'] = array( |
There was a problem hiding this comment.
did you removed this field on purpose ? or is it by mistake ?
| } | ||
| } | ||
|
|
||
| // Pro rate price checkbox |
There was a problem hiding this comment.
would it be easy to move this logic to a new private method with a clear name ?
| /** | ||
| * Validate function for membership date rules. | ||
| */ | ||
| public function validateMembershipDateRules() { |
There was a problem hiding this comment.
no need for this to be public method
| * Validate function for membership date rules. | ||
| */ | ||
| public function validateMembershipDateRules() { | ||
| if (!empty($this->data['membership'])) { |
There was a problem hiding this comment.
or :
if (empty($this->data['membership'])) {
return;
}
// rest of the code
| * @param Array $item | ||
| * @return Float $price | ||
| */ | ||
| private function pro_rated_membership_fee($type, $price, $c, $n, $item) { |
There was a problem hiding this comment.
or change the method name to : caculateMembershipProRateFee
| * @param Float $price | ||
| * @param Integer $c | ||
| * @param Array $item | ||
| * @return Float $price |
There was a problem hiding this comment.
the docblock params does not match the method params
| * @param Array $item | ||
| * @return Float $price | ||
| */ | ||
| private function pro_rated_membership_fee($type, $price, $c, $n, $item) { |
There was a problem hiding this comment.
can you replace $c and $n and $item with names that represent what they actually about.
Overview:
In Webform/CiviCRM it is not possible
Solution:
This PR adds the functionality to