Home Forums WC Vendors Free Support Actions/filters in vendor notification email

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 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9051
    Tempera
    Participant

    Hi!

    I have a question from the developer that is building a new functionality on my site. We are trying to add some information to the vendor emails.

    This is the difficulty encountered: “There is no action and filter in the wc_vendor plugin for email so we need to ask to wc_vendor to add action as we needed or we can add action there so we need to insert code after each update the version of wc_plugin”

    Then they say: “Yes there is a filter to add content in this but the problem is that. We can’t find the vendor which we send that email. I have added content in other email but the problem is only occur in the vendor email because there is no action or filter which can handle the vendor which we send email.”

    So I think the question is if WC Vendors has actions and filters for adding content in email notifications for specific vendors? – if I understood correctly.

    I hope you can understand the issue and guide us to what is appropriate to use in this case.

    #9052
    WC Vendors Support
    Participant

    Hi Tempera,

    https://github.com/wcvendors/wcvendors/blob/master/templates/emails/vendor-new-order.php

    You’ll see the following filters are in the email templates:

    woocommerce_email_header
    woocommerce_email_before_order_table
    woocommerce_email_after_order_table
    woocommerce_email_order_meta
    woocommerce_email_footer

    And in all of those except the header/footer filter pass the order as $order. So with the $order you can lookup what vendor sold what, and do stuff pretty easily.

    Beyond that, I didnt really understand what exactly what he was asking for. If your developer sees a reason to add more filters beyond this, have him reference this file and send in a patch with new filters included in the patch and we’ll review it for inclusion in the next WC Vendors Update. 🙂

    Ben

    #9250
    Tempera
    Participant

    Thank you, Ben!

    I conveyed the message, but it seems there is still confusion, the developer said this:
    “yes I know the these action but from these action we can’t find the vendor id whom we send email, I can’t get vendor id here so I can’t add different content to different vendor in email.”

    Ami

    #9252
    Jamie
    Keymaster

    Hi Tempera,

    The following is the class that he needs to look at to see how to override the emails.

    https://github.com/wcvendors/wcvendors/blob/master/classes/admin/emails/class-emails.php

    This will give him the information he requires, we hook into the filters listed above and override. He should be able to do the same thing.

    cheers,

    Jamie.

    #9373
    Tempera
    Participant

    Thank you, Jamie!

    Unfortunately, it seems the developer is still confused:

    “In wc vendor notofication email. I want to appand a content and for this I have found many filters to add content before and after.

    But I want to add the different content for different vendor and I can’t get vendor ID in any filter. I mean how we can get the id of vendor user which notification email is being send ?

    like for vendor1 I want to add content like current vendor informations.”

    #9374
    WC Vendors Support
    Participant

    They would look at the order number, or the product number, and get the post_author for that, which is the vendor ID. 🙂

Viewing 6 posts - 1 through 6 (of 6 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.