Home › Forums › WC Vendors Free Support › Data of the vendor for the customer
NOTICE: We've Moved to a Ticket System for Support
As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system. This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.
For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.
If you are a WC Vendors Pro customer please open a support ticket here. If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.
The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.
Thank you to all of our customers!
- This topic has 31 replies, 7 voices, and was last updated 6 years, 11 months ago by Robson Gomes.
-
AuthorPosts
-
September 18, 2015 at 2:07 pm #8941CriterioNetParticipant
I am referring to email notifications. Now the seller will get the customer data. But not vice versa. I need the email notification to the customer, vendor data is displayed.
Viewing email template, note that under the product name, vendor name is displayed. Is possible also show the email and the phone?
Trying to do this, reaches the files I need to change.
/public_html/wp-content/plugins/woocommerce/templates/emails/customer-completed-order.phpBut as I get data variables of the vendor? to be displayed in the template.
Thanks.
September 18, 2015 at 2:21 pm #8946WC Vendors SupportParticipantProbably the easiest way to do this is going to be with this function below:
https://gist.github.com/bentasm1/714bf1be90ee96f6aefe
The code as shown above will add the vendors email. You can modify it any way you want to show additional information you store for your vendors. 🙂
Ben
September 18, 2015 at 2:41 pm #8953CriterioNetParticipantNot really show the email below the product name, but under the table. Where customers are shown “Your data” showing: Vendor details and then the email and the phone vendor for contact.
(always talking about the email that received the customer)
September 18, 2015 at 2:44 pm #8954WC Vendors SupportParticipantThis will show it in the email that is sent to the customer, yup. 🙂
You can use similar code in the completed order email templates to customize that any way you see fit. Code it up, add it in!
September 18, 2015 at 4:07 pm #8971CriterioNetParticipantHow to replace the default template WC for my template?
/public_html/wp-content/plugins/woocommerce/templates/emailscustomer-completed-order.php
Copy the template within
/public_html/wp-content/plugins/wc-vendors/templates/emails
and modify ?
September 18, 2015 at 4:18 pm #8974CriterioNetParticipantWhat I’m trying to make is that the two users will get the data from the other, so they can coordinate delivery.
September 18, 2015 at 4:19 pm #8975May 3, 2016 at 7:33 am #31371AndyParticipantHi Ben,
being as I have decided not to show the vendor’s address and phone number on the vendor store page, so as potential buyers don’t go directly to the vendor, I tried using the above code which works for me but I really have no idea how to add further information such as vendor’s address and telephone number. Can you please guide me when you have some time? I’ve searched the forums but found no answer.
Thanks in advance for any help,
Andy 🙂
May 3, 2016 at 11:39 am #31394WC Vendors SupportParticipantNope! This is all you to figure out. 🙂 We just dont have the time to write custom code, we’re too slammed working on everything else for core still.
May 4, 2016 at 7:32 am #31475AndyParticipantOk I get it 😉
For what its worth I figured it out, the code is probably a mess as I have no idea what I’m doing but it works for some reason. For anyone looking for this here’s my ugly version.
Use at your own risk 😉
/* This will add the vendors email address, phone number and address after their Shop Name in WC Vendors customer email conformation */
remove_action( ‘woocommerce_add_order_item_meta’, array(‘WCV_Vendor_Shop’, ‘add_vendor_to_order_item_meta’), 10, 2 );
add_action( ‘woocommerce_add_order_item_meta’, ‘custom_add_vendor_to_order_item_meta’, 10, 2);
function custom_add_vendor_to_order_item_meta( $item_id, $cart_item) {
$vendor_id = $cart_item[ ‘data’ ]->post->post_author;
$vendor_data = get_userdata( $vendor_id ); // Fetch vendor data as array
$vendor_email = $vendor_data->user_email; // Store email as a string
$vendor_phone = get_user_meta($vendor_id, ‘_wcv_store_phone’, true);
$vendor_address1= get_user_meta($vendor_id, ‘_wcv_store_address1’, true);
$vendor_store_postcode = get_user_meta($vendor_id, ‘_wcv_store_postcode’, true);
$vendor_city = get_user_meta($vendor_id, ‘_wcv_store_city’, true);
$vendor_state = get_user_meta($vendor_id, ‘_wcv_store_state’, true);
$sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::get_vendor_sold_by( $vendor_id ) ): get_bloginfo( ‘name’ );
$sold_by_and_email = $sold_by . ‘:’ . ‘<br> <b>E-Mail: </b>’ . $vendor_email . ‘<br><b> Telefon Nr.:</b> ‘ . $vendor_phone . ‘<br> <b>Adresse: </b>’ . $vendor_address1 . ‘, ‘ .$vendor_store_postcode . ‘, ‘ . $vendor_city . ‘, ‘ . $vendor_state;
wc_add_order_item_meta( $item_id, apply_filters(‘wcvendors_sold_by_in_email’, __(‘<b>Verkauft durch</b>’, ‘wcvendors’)), $sold_by_and_email);
}June 22, 2016 at 3:35 pm #35371MichaelParticipantThat worked great, Andy. Thank you very much for sharing that solution!
June 23, 2016 at 4:36 am #35435AndyParticipantGlad to help.
July 20, 2016 at 10:56 am #37693CriterioNetParticipantWith the latest update, I have noticed a change in the view of my orders. Seller information also appears here now. Should not appear my own information (irrelevant)
July 21, 2016 at 3:38 pm #37812WC Vendors SupportParticipantYou can hide customer details in your WC Vendors settings. Check your options. 🙂
February 12, 2017 at 12:40 pm #55876ShaneParticipantAnyone have any idea where Andy would’ve put that code? I followed the link Ben posted and then put the code in the file copied to my theme but it appears to have broke the email – it did not send.
February 12, 2017 at 6:43 pm #55908AnnaMember@ShaneH
This would go in your theme/child theme functions.php
However, since it was not posted in a code format (between the code & /code ) when posted- you’re not getting the right format.
I cleaned it up.. try now:
https://gist.github.com/fervous/c9a09eb789da4bf9b080a3fda98319edFebruary 12, 2017 at 9:25 pm #55924ShaneParticipantI appreciate the help. I have put it in the Child themes functions php file. Hmm no luck still. It is only showing “Sold by: [Store name]”.
Thanks,
ShaneFebruary 15, 2017 at 2:41 pm #56235ShaneParticipant@fervous ,
Hate to bother but can you think of anything that would make that not work when added to the child theme’s functions php file? Having a tough time figuring this one out.
Thanks,
ShaneFebruary 15, 2017 at 9:14 pm #56270AnnaMember@ShaneH
It still had a couple of curly/fancy quotes in it that I missed.
Try again… see if it works. I have updated the Gist above ^February 22, 2017 at 8:25 pm #57224ShaneParticipantNo luck :/
I am attaching a picture of what the email that gets sent looks like. Here is my child themes functions.php file in entirety:<?php // Do not allow directly accessing this file. if ( ! defined( 'ABSPATH' ) ) { exit( 'Direct script access denied.' ); } if ( defined( 'RH_GRANDCHILD_DIR' ) ) { include( RH_GRANDCHILD_DIR . 'rh-grandchild-func.php' ); } add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' ); function enqueue_parent_theme_style() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); if (is_rtl()) { wp_enqueue_style( 'parent-rtl', get_template_directory_uri().'/rtl.css' ); } } // Add specific CSS class by filter add_filter('body_class','style_body_repick'); function style_body_repick($classes) { $classes[] = 'no_bg_wrap'; return $classes; } ////////////////////////////////////////////////////////////////// // Translation ////////////////////////////////////////////////////////////////// add_action('after_setup_theme', 'rehubchild_lang_setup'); function rehubchild_lang_setup(){ load_child_theme_textdomain('rehubchild', get_stylesheet_directory() . '/lang'); } /* begin add Vendor contact information to order email - This will add the vendors email address, phone number and address after their Shop Name in WC Vendors customer email conformation */ remove_action( 'woocommerce_add_order_item_meta', array('WCV_Vendor_Shop', 'add_vendor_to_order_item_meta'), 10, 2 ); add_action( 'woocommerce_add_order_item_meta', 'custom_add_vendor_to_order_item_meta', 10, 2); function custom_add_vendor_to_order_item_meta( $item_id, $cart_item) { $vendor_store_postcode = get_user_meta($vendor_id, '_wcv_store_postcode', true); $vendor_city = get_user_meta($vendor_id,'_wcv_store_city', true); $vendor_state = get_user_meta($vendor_id, '_wcv_store_state', true); $sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::get_vendor_sold_by( $vendor_id ) ): get_bloginfo( 'name' ); $sold_by_and_email = $sold_by . ':' . '<br> <b>E-Mail: </b>' . $vendor_email . '<br><b> Telephone #.:</b> ' . $vendor_phone . '<br> <b>Address: </b>' . $vendor_address1 . ', '.$vendor_store_postcode . ', ' . $vendor_city . ','. $vendor_state; wc_add_order_item_meta( $item_id, apply_filters('wcvendors_sold_by_in_email', __('<b>Verkauft durch</b>', 'wcvendors')), $sold_by_and_email); } /* end add Vendor contact information to order email*/ ?>
February 23, 2017 at 11:10 am #57342AnnaMember@SHANEH
I’ll try to take a look at the code later today.
You have it placed correctly- the code just must not be correct for what you are trying to do– I just have not actually tested it and looked it over thoroughly. I only helped with the formatting.I’ll bookmark this and visit back when I have the time to look it over.
February 23, 2017 at 8:00 pm #57404ShaneParticipantAwesome, thank you for the help. I mean it is pretty common in a marketplace to have a way to contact the vendor so I imagine there is at least some other built-in way to do this right? I just had assumed it had to be through the email but if there is an easier or pre-built in way please let me know as well.
Thank you,
ShaneFebruary 23, 2017 at 8:14 pm #57407WC Vendors SupportParticipantFor sure. Most marketplaces will either use this method, or BuddyPress. Both are equally as common. I like BuddyPress more. Keeps people on the site rather than lets them complete a deal via email without me.
February 23, 2017 at 8:45 pm #57408ShaneParticipantThanks @Ben, I will try that out! I like the communication being on my platform better as well.
Thanks,
ShaneFebruary 23, 2017 at 9:27 pm #57414ShaneParticipant@ben
Awesome suggestion. I have got it going and this is way better than what I wanted anyways. @fervous – unless you want to have it documented here/corrected you don’t need to look into it for me any longer. I appreciate your help but the BuddyPress system seems perfect. Thanks guys!
– Shane
February 23, 2017 at 9:38 pm #57416AnnaMember@SHANEH
I guess I should’ve suggested that, too. I also prefer the BP route– keeps everything on site. Glad it is working for ya- and I have no problem NOT trying to debug that code above ^^ lol. 😀March 4, 2017 at 10:48 am #58205Robson GomesParticipantI have not found any option that does this in BuddyPress. Did you check how to do it here?
Thanks!March 4, 2017 at 10:54 am #58207AnnaMember@robsongomes
Hello,
If you use the BuddyPress plugin on your site as well as WC Vendors or WC Vendors Pro, we have some code here in our knowledgebase which will assist you in creating some buttons or links ont he product page and in the user’s buddypress profile page that will link the prfile & vendor store- and will allow for a “contact me” button for buddypress messaging between the site members (users have to be registered on your site & logged in to send a message).
See here for WC Vendors (free): https://www.wcvendors.com/kb/integrating-buddypress-profiles/and for Pro: https://www.wcvendors.com/kb/integrating-with-buddypress-profiles-pro-only/
There is also this plugin that a third-party made, some users really find it to be great:
https://wordpress.org/plugins/bp-wc-vendors/March 4, 2017 at 12:18 pm #58218Robson GomesParticipantThank you.
Here this code did nothing. I just needed the vendor’s email visible to the customer. I’m going to search for another marketplace plugin.
March 4, 2017 at 8:09 pm #58249AnnaMember@robsongomes
Why? Is there something else you need for your multi-vendor website?
We are integrated with WooCommerce Product Enquiry also, which will send an email to the vendor. Or, we can work on making the vendor email visible also.
I only discussed the buddypress with you since that is what you asked about, but I am glad to help if you have other questions or needs.March 5, 2017 at 12:06 am #58264Robson GomesParticipantThank you Anna,
My site connects students already approved in a university discipline (vendor) with those who are still attending (client). Usually, the purchase occurs near the test date. I can not leave the vendor information visible on the site, because as they are in the same environment, they would not buy through the site. When the sale occurs, the customer’s data goes to the vendor. If the vendor is not fast enough it generates an unpleasant situation. It is for this reason that the vendor contact on the customer email, after the payment seems to me to be a possible flow.Grateful.
April 27, 2017 at 10:44 am #63538Robson GomesParticipantHave we made any progress in this situation?
-
AuthorPosts
- The forum ‘WC Vendors Free Support’ is closed to new topics and replies.