Created
September 2, 2016 03:34
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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