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.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 32 posts - 1 through 32 (of 32 total)
  • Author
    Posts
  • #8941
    CriterioNet
    Participant

    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.php

    But as I get data variables of the vendor? to be displayed in the template.

    Thanks.

    #8946
    WC Vendors Support
    Participant

    Probably 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

    #8953
    CriterioNet
    Participant

    Not 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)

    #8954
    WC Vendors Support
    Participant

    This 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!

    #8971
    CriterioNet
    Participant

    How 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 ?

    #8974
    CriterioNet
    Participant

    What I’m trying to make is that the two users will get the data from the other, so they can coordinate delivery.

    #8975
    WC Vendors Support
    Participant
    #31371
    Andy
    Participant

    Hi 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 🙂

    #31394
    WC Vendors Support
    Participant

    Nope! 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.

    #31475
    Andy
    Participant

    Ok 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);
    }

    #35371
    Michael
    Participant

    That worked great, Andy. Thank you very much for sharing that solution!

    #35435
    Andy
    Participant

    Glad to help.

    #37693
    CriterioNet
    Participant

    With 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)

    #37812
    WC Vendors Support
    Participant

    You can hide customer details in your WC Vendors settings. Check your options. 🙂

    #55876
    Shane
    Participant

    Anyone 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.

    #55908
    Anna
    Member

    @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/c9a09eb789da4bf9b080a3fda98319ed

    #55924
    Shane
    Participant

    @fervous,

    I 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,
    Shane

    #56235
    Shane
    Participant

    @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,
    Shane

    #56270
    Anna
    Member

    @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 ^

    #57224
    Shane
    Participant

    @fervous

    No 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*/
    
    ?>
    #57342
    Anna
    Member

    @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.

    #57404
    Shane
    Participant

    @fervous

    Awesome, 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,
    Shane

    #57407
    WC Vendors Support
    Participant

    For 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.

    #57408
    Shane
    Participant

    Thanks @Ben, I will try that out! I like the communication being on my platform better as well.

    Thanks,
    Shane

    #57414
    Shane
    Participant

    @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

    #57416
    Anna
    Member

    @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. 😀

    #58205
    Robson Gomes
    Participant

    I have not found any option that does this in BuddyPress. Did you check how to do it here?
    Thanks!

    #58207
    Anna
    Member

    @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/

    #58218
    Robson Gomes
    Participant

    Thank 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.

    #58249
    Anna
    Member

    @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.

    #58264
    Robson Gomes
    Participant

    Thank 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.

    #63538
    Robson Gomes
    Participant

    Have we made any progress in this situation?

Viewing 32 posts - 1 through 32 (of 32 total)
  • The forum ‘WC Vendors Free Support’ is closed to new topics and replies.