Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Modify email sent to the buyer after the purchase
- This topic has 3 replies, 2 voices, and was last updated 4 years, 7 months ago by Sarmistha Chakraborty.
- AuthorPosts
- April 25, 2020 at 2:56 am #122737rech.alexisParticipant
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! - April 25, 2020 at 1:34 pm #122847Sarmistha ChakrabortyMember
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.
- April 28, 2020 at 5:52 pm #124236rech.alexisParticipant
It worked perfectly!!! thank you so much!! You’re the best!!
- April 28, 2020 at 7:32 pm #124289Sarmistha ChakrabortyMember
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
- AuthorPosts
- The topic ‘Modify email sent to the buyer after the purchase’ is closed to new replies.