Closed knit-pay closed 3 years ago
Hello Team Many of my clients are asking to show the campaign name in the payment description. I made this small change in CharitableHelper class, get_description function. May I raise a pull request if you find it helpful?
CharitableHelper
get_description
public static function get_description( $gateway, $donation_id ) { $description = $gateway->get_value( 'transaction_description' ); $donation = new Charitable_Donation( $donation_id ); if ( '' === $description ) { $description = self::get_title( $donation_id ); } // Replacements. $replacements = array( '{donation_id}' => $donation_id, '{first_campaign_name}' => reset($donation->get_campaigns()), ); return \strtr( $description, $replacements ); }
Nice addition, pull request welcome.
https://github.com/Charitable/Charitable/blob/1.6.50/includes/abstracts/abstract-class-charitable-abstract-donation.php#L315-L324
Merged https://github.com/wp-pay-extensions/charitable/pull/3
Hello Team Many of my clients are asking to show the campaign name in the payment description. I made this small change in
CharitableHelper
class,get_description
function. May I raise a pull request if you find it helpful?