-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue/1716 #1740
Issue/1716 #1740
Conversation
@@ -538,14 +538,28 @@ public function get_payment_id( $payment ) { | |||
*/ | |||
public function get_donor( $payment ) { | |||
|
|||
$customer_id = give_get_payment_customer_id( $payment->ID ); | |||
$customer_id = give_get_payment_customer_id( $payment->ID ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 instead of $customer_id, update it to $donor_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk changed naming terminology as per your suggestion
@@ -538,14 +538,28 @@ public function get_payment_id( $payment ) { | |||
*/ | |||
public function get_donor( $payment ) { | |||
|
|||
$customer_id = give_get_payment_customer_id( $payment->ID ); | |||
$customer_id = give_get_payment_customer_id( $payment->ID ); | |||
$donor_name = give_get_donor_name_by( $payment->ID, 'donation'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 $donor_name should be $donor_billing_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk changed naming terminology as per your suggestion
$customer_id = give_get_payment_customer_id( $payment->ID ); | ||
$customer_id = give_get_payment_customer_id( $payment->ID ); | ||
$donor_name = give_get_donor_name_by( $payment->ID, 'donation'); | ||
$customer_name = give_get_donor_name_by( $customer_id, 'donor'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 $customer_name should be $donor_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk changed naming terminology as per your suggestion
includes/user-functions.php
Outdated
* Retrieves the donor name based on the id and the name of the user or donation | ||
* | ||
* @access public | ||
* @since 1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 @since
must say 1.8.8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk This is a minor issue which is missed. However, i'll make sure that this will be double checked by me next time submitting a PR.
includes/user-functions.php
Outdated
* @param int $id The ID of donation or donor | ||
* @param string $from From will be a string to be passed as donation or donor | ||
* | ||
* @return array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 this function must return string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk This is a minor issue which is missed. However, i'll make sure that this will be double checked by me next time submitting a PR.
case 'donation': | ||
|
||
$user_info = give_get_payment_meta_user_info( $id ); | ||
$name = $user_info['first_name'] . ' ' . $user_info['last_name']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 use trim
function on $name
because it is not necessary that donor will have last name, so we do not want to add space after name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk Used trim
while returning the $name
string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk This is a minor issue which need to be taken care of. However, while coding i'll make sure that the string can contain spaces and there are possibilities of using trim
when the string is filled by an actual user.
includes/user-functions.php
Outdated
|
||
case 'donor': | ||
|
||
$customer = new Give_Customer( $id ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 start using donor term instead of customer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk Sure. I'll make sure of that now.
@@ -512,7 +512,17 @@ | |||
<div class="column"> | |||
<p> | |||
<strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br> | |||
<?php echo $customer->name; ?> | |||
<?php | |||
$donor_name = give_get_donor_name_by( $payment_id, 'donation' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 $donor_name should be $donor_billing_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk changed naming terminology as per your suggestion
<?php echo $customer->name; ?> | ||
<?php | ||
$donor_name = give_get_donor_name_by( $payment_id, 'donation' ); | ||
$customer_name = give_get_donor_name_by( $customer_id, 'donor' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 $customer_name should be $donor_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk changed naming terminology as per your suggestion
$customer_name = give_get_donor_name_by( $customer_id, 'donor' ); | ||
|
||
// Check whether the donor name and WP_User name is same or not. | ||
if( sanitize_title( $donor_name ) != sanitize_title( $customer_name ) ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehul0810 output donor billing name + donor name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravinderk Updated code with outputing donor billing name + donor name on detail page as well and similar to listing page
Description
This PR is for #1716
How Has This Been Tested?
I've tested this on donation detail page as well as donation listing page with the below scenarios:
Screenshots (jpeg or gifs if applicable):
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: