Created
February 13, 2020 05:31
-
-
Save webtoffee-git/1243fd32d093e77d438dcbef1a464f2d to your computer and use it in GitHub Desktop.
Change Order description in Stripe dashboard using WooCommerce Stripe Payment Gateway plugin by WebToffee
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
add_filter('eh_stripe_charge_description_details', 'webtoffee_stripe_charge_description', 10, 2); | |
function webtoffee_stripe_charge_description($description, $wc_order) { | |
$description = ''; | |
foreach ($wc_order->get_items() as $item) { | |
$description .= $item['name'] . ' * ' . $item['quantity'] . ' | '; | |
} | |
return substr_replace($description, "", -2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment