Editing Stripe Description line to include product category
-
Hello,
We are trying to edit the Description line when viewing transaction details in the Stripe interface. We have used snippets found in support articles to try and create this, but it doesn’t appear to be working. Here’s what we have. Could you take a look and let us know where the error in the code is?
add_filter(‘wc_stripe_payment_intent_args’, function($args){
$theOrder = $order->get_order_number();
$items = $theOrder->get_items();
$cat_names = array();
foreach ( $items as $item ) {
$product_id = $item->get_product_id();
$terms = get_the_terms ( $product_id, ‘product_cat’ );
foreach ( $terms as $term ) {
$cat_names[] = $term->name;
}
}
$cats = implode(‘, ‘, $cat_names);
$args[‘description’] = sprintf(‘Order %1$s’, $cats);
return $args;
});The page I need help with: [log in to see the link]
- The topic ‘Editing Stripe Description line to include product category’ is closed to new replies.