woocommerce coupons description in order email

I’ve got a problem to show coupon description in thank you order mail.

I have name of coupon by using:

Read More
$order->get_used_coupons()

But above function returns only namen. Any one know how to get description for specific coupon name?

Related posts

1 comment

  1. Try this code:

    $coupons = $order->get_items( 'coupon' );
      foreach ( $coupons as $item_id => $item ) {
        echo "<span class='coupon-name'><b>".$item['name']."</b></span>";
        $post = get_post( $item_id );
        echo "<p class='coupon-description'>".$post->post_excerpt."</p>";
      }
    }
    

Comments are closed.