Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

I want to reverse the output order of the first name and last name for the custo

WCMp Core

Resolved
Viewing 3 reply threads
  • Author
    Posts
    • #123066
      Naoya Ishikawa
      Participant

      I want to reverse the output order of the first name and last name for the customer name in the order details that can be downloaded by CSV.
      Is it possible to change the template by overwriting it?
      If not, please let me know the location of the source.
      Thank you.

    • #123103

      Hi,
      Yes this is possible. But for you we are giving complete code snippet. Use this below code in your currently active theme functions.php file.

      add_filter('wcmp_vendor_order_generate_csv_data', function($dtails, $customer_order, $vendor) {
          $order = wc_get_order($customer_order);
          $customer_name = $order->get_billing_last_name() . ' ' . $order->get_billing_first_name();
          $dtails['buyer_name'] = $customer_name;
          return $dtails;
      }, 10, 3);
      Copy

      Now Enjoy 🙂

    • #123114
      Naoya Ishikawa
      Participant

      I was able to solve it
      Thank you very much!

    • #123115

      Great to know that @Naoya Ishikawa

      We would love it if you shared your experience by giving us 5/5 review here : https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post
      Seeing glowing reviews from existing customers makes others more comfortable knowing they’ll get the support they need should an issue with our services arise.

Viewing 3 reply threads

The topic ‘I want to reverse the output order of the first name and last name for the custo’ is closed to new replies.