Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created February 13, 2020 05:31
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 webtoffee-git/1243fd32d093e77d438dcbef1a464f2d to your computer and use it in GitHub Desktop.
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
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