• I’ve inherited a new client has been using this filter successfully for a long time, but recently it stopped working. The filter would change the transaction name so that it shows in the Stripe dashboard in this format:

    Order: #123456 – Payment for Cool Product

    This strikes me as odd, because I can’t find any reference to this filer online except for a couple of places having the same issue. Even older versions of the plugin as far back as 9.5 have no reference to it in the source. Yet I have seen with my own eyes, their Stripe dashboard showing the modified transaction descriptions (up until it stopped working).

    My question: Is it at all still possible to modify it?

    Here’s the filter in question (from functions.php):

    add_filter(‘wc_stripe_payment_description’, function($description, $order){
    $items = $order->get_items();
    $product_names = [];
    foreach ($items as $item) {
    $product = wc_get_product($item[‘product_id’]);
    if ($product) {
    $product_names[] = $product->get_title();
    }
    }
    if (!empty($product_names)) {
    return sprintf(‘Order: #%s – Payment for %s’, $order->get_order_number(), implode(‘, ‘, $product_names));
    }
    return $description; // Fallback
    }, 10, 2);

Viewing 1 replies (of 1 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there,

    Thank you for sharing your issue in detail. I have reviewed the information, and I’m unable to find the hook you are currently using to change the description.

    However, I did find that the following filter, wc_stripe_description, was added to allow customization of the payment description. You can see it referenced here: GitHub Search: wc_stripe_description

    Additionally, here is a list of all available filters and hooks in the WooCommerce Stripe plugin: Action and Filter Hooks

    For reference, these particular forums are meant for general support with the core functionality of the WooCommerce Stripe Payment Gateway plugin. For development and custom coding questions, it’s best to ask for insight related to those on  WooCommerce Community Slack.

    You can also seek help from the following:

    I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.