Skip to content

Instantly share code, notes, and snippets.

@webaware
Created September 2, 2016 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webaware/4635d476e506c95c26c66a121631a7dc to your computer and use it in GitHub Desktop.
Save webaware/4635d476e506c95c26c66a121631a7dc to your computer and use it in GitHub Desktop.
Temporary fix for WP eCommerce not reporting Payment Method in notification emails. See https://github.com/wp-e-commerce/WP-e-Commerce/issues/2152
<?php
/*
Plugin Name: WP eCommerce Payment Method notifications fix
Plugin URI: https://gist.github.com/webaware/4635d476e506c95c26c66a121631a7dc
Description: temporary fix for WP eCommerce not reporting Payment Method in notification emails
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
if (!defined('ABSPATH')) {
exit;
}
add_filter('wpsc_purchase_log_notification_common_args', function($args, $notification) {
if (empty($args['payment_method'])) {
$args['payment_method'] = $notification->get_purchase_log()->get('gateway');
}
return $args;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment