Modify email sent to the buyer after the purchase

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 3 reply threads
  • Author
    Posts
    • #122737
      rech.alexis
      Participant

      Hello dear Admin,
      after the purchase, the buyer receives an email to confirm “thank you for your order”. How can i include in this email the seller infomation? (he cant see them before because i blocked the seller profil informatio).
      Thank you very much for your help and your time!

    • #122847

      Hello,

      To show seller information only customer/buyer email, Add this code in your functions.php

      add_action( 'woocommerce_email_order_meta', 'add_sellerinfo_to_buyer_email',50,4 );
      function add_sellerinfo_to_buyer_email( $order, $sent_to_admin, $plain_text, $email ) {
      	global $WCFM;
      	if ( !in_array( $email->id, array( 'new_order','store-new-order') )){ 
      		$items = $order->get_items();
      		echo '<p>Seller Information -</p>';
      		foreach ( $items as $item ) {
      			$product_id = $item->get_product_id();
      			$vendor_id   = wcfm_get_vendor_id_by_post( $product_id );
      			if( apply_filters( 'wcfmmp_is_allow_sold_by_linked', true ) ) {
      				$store_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($vendor_id) );
      			} else {
      				$store_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_name_by_vendor( absint($vendor_id) );
      			}
      			$store_user  = wcfmmp_get_store( $vendor_id );
      			$email    = $store_user->get_email();
      			$phone    = $store_user->get_phone(); 
      			$address  = $store_user->get_address_string(); 
      			echo $store_name.'('.$item->get_name().') :'.$email.' '.$phone.'<br/>';
      		}
      	}
      }

      Or if You want seller/vendor information for all order emails, then try this code,

      add_action( 'woocommerce_order_item_meta_end', 'add_sellerinfo_to_all_order_email',50,4 );
      function add_sellerinfo_to_all_order_email( $item_id, $item, $order, $plain_text ) {
      	$product_id = $item->get_product_id();
      	$vendor_id   = wcfm_get_vendor_id_by_post( $product_id );
      	$store_user  = wcfmmp_get_store( $vendor_id );
      	$email    = $store_user->get_email();
      	$phone    = $store_user->get_phone(); 
      	$address  = $store_user->get_address_string(); 
      	echo 'Seller Information: '.$email.' '.$phone;
      }

      Modify the seller information print section(HTML) as per your requirement.

      Thanks.

    • #124236
      rech.alexis
      Participant

      It worked perfectly!!! thank you so much!! You’re the best!!

    • #124289

      You are always welcome 🙂

      Let me know if there’s anything else we can help you with.
      Can we ask for a favor? Would you mind taking a few minutes to review our plugin at https://wordpress.org/support/plugin/wc-multivendor-marketplace/reviews/ and let others know about your 5 Star experience with WCFM Marketplace. Also, follow us on Twitter https://twitter.com/wcfmmp for more exciting news, important updates, and irresistible offers

Viewing 3 reply threads
  • The topic ‘Modify email sent to the buyer after the purchase’ is closed to new replies.