Home Forums WC Vendors Free Support Sent Product Enquiry emails also to site owner

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 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #8225
    Johnny
    Participant

    Hi,

    Woohems Product Enquiry works fine with WC Vendor, users receive emails, but would it be possible that all emails were sent also to the site admins email?

    Thanks

    #8233
    WC Vendors Support
    Participant

    Hi Johnny,

    You could remove the filter we use for it and rewrite it to add the extra send to addresses, IF Product Enquiry supports that. We return one email address to them. You might be able to return two email addresses to them, but I’m not sure.

    https://github.com/wcvendors/wcvendors/blob/master/classes/front/class-vendor-shop.php#L67 That is the function that returns the email address.

    remove_filter( ‘product_enquiry_send_to’, array( ‘WCV_Vendor_Shop’, ‘product_enquiry_compatibility’ ), 10, 2 ); — Add this to your functions.php file, and then re-add the filter yourself with your own function from the file quoted in the previous paragraph to modify the send to go to two senders.

    If this doesn’t work, you’ll want to ask WooThemes how to send the Enquiry to an additional sender each time, they probably will have to add code for it for you, if this does not work.

    Cheers

    Ben

    #8255
    Johnny
    Participant

    Hi Ben,

    if you write 2 addresses in the Product Enquiry where to send email it works, just need to separate it by comma..

    So i remove this:

    add_filter( ‘product_enquiry_send_to’, array( ‘WCV_Vendor_Shop’, ‘product_enquiry_compatibility’ ), 10, 2 );

    and add it to my themes function.php file, right?

    Will try and let you know how it goes….
    Thanks

    #8256
    WC Vendors Support
    Participant

    Excellent.

    You would add:

    remove_filter( ‘product_enquiry_send_to’, array( ‘WCV_Vendor_Shop’, ‘product_enquiry_compatibility’ ), 10, 2 );

    in your themes functions.php file.

    And then directly after that:

    add_filter( ‘product_enquiry_send_to’, ‘your_custom_function’, 10, 2 );

    and then copy the function we use called product_enquiry_compatibility as your_custom_function and modify it to send to both emails.

    #8262
    Johnny
    Participant

    Added these:

    remove_filter( ‘product_enquiry_send_to’, array( ‘WCV_Vendor_Shop’, ‘product_enquiry_compatibility’ ), 10, 2 );
    add_filter( ‘product_enquiry_send_to’, ‘your_custom_function’, 10, 2 );

    But did not understand this one, need help:

    and then copy the function we use called product_enquiry_compatibility as your_custom_function and modify it to send to both emails.

    #8263
    WC Vendors Support
    Participant

    Sure. Let me explain. You’ve removed the filter that causes the WC Vendors code to send it to the vendor. You did that because it only sends it to the vendor, not both emails.

    Then you added a filter, and you should change the “your_custom_function” to something else unique to YOUR site (such as “johnny_enquiry”) or whatever.

    And then after that you need to create a new function, called “johnny_enquiry” so that the filter calls your function.

    The function code you want to copy is here:

    https://github.com/wcvendors/wcvendors/blob/master/classes/front/class-vendor-shop.php on line #67.

    Copy that function, add in your code to send two email addresses instead.

    And with that knowledge you can replace damn near any function you like in most every plugin. 🙂

    #8264
    Johnny
    Participant

    not so good at programming….

    Ok, called it johnny_enquiry

    themes function.php:
    remove_filter( ‘product_enquiry_send_to’, array( ‘WCV_Vendor_Shop’, ‘product_enquiry_compatibility’ ), 10, 2 );
    add_filter( ‘product_enquiry_send_to’, ‘johnny_enquiry’, 10, 2 );

    johnny_enquiry should be a .php file?
    and it should contain this:
    public static function product_enquiry_compatibility( $send_to, $product_id )

    Thanks

    #8268
    WC Vendors Support
    Participant

    Bah, you’re making me do all the hard work. 😉 😉

    Give this a shot, it’s coded as you instructed to send the return properly. Havent tested it, that’s your job. 🙂 Drop into your themes functions.php file.

    https://gist.github.com/bentasm1/1ab3ba702683a733daa4

    Ben

    #8270
    Johnny
    Participant

    Ben, you are amazing…

    Of course it works 100% – tested and working fine…

    I own you a bunch…

    Learning a few thing and thank you for that to…

    Thank you…
    Thank you…
    Thank you…

    #8271
    WC Vendors Support
    Participant

    Glad its working well. I hope you learned a little bit about filters and functions along the way. 🙂

    Cheers

    #8294
    Johnny
    Participant

    Hi Ben,

    one more thing, when the 2 email are sent to the vendor and admin the email field TO has bout emails / the vendors and admins….

    Is there a way how to show only 1 email?

    The vendor should see his email…
    The admin should see his email…

    Thanks

    #8307
    WC Vendors Support
    Participant

    You would have to show the code I wrote to WooThemes and ask them how to make the second email a BCC field. Otherwise, yes, if it’s sent to two emails, they will show up in the email that it was sent to two addresses. If WooThemes can add a filter for a bcc email address, that would solve the problem for sure.

    #26931
    Eric
    Participant

    Ben,

    What if you don’t want the vendor to receive any of the emails and just us as the admin? So all product enquiries would go to us, the admin, and we would work directly with the vendor to answer questions from potential customers? Would I just take out the comma and space in the above coding?

    #26961
    WC Vendors Support
    Participant

    Eric: All you’d have to remove is the filter:

    remove_filter( 'product_enquiry_send_to', array( 'WCV_Vendor_Shop', 'product_enquiry_compatibility' ), 10, 2 );

    Drop in functions.php and enjoy! 🙂

Viewing 14 posts - 1 through 14 (of 14 total)
  • The forum ‘WC Vendors Free Support’ is closed to new topics and replies.
This website uses cookies to ensure you get the best experience on our website.