Home Forums WC Vendors Free Support Product Enquiry Form – Fatal Error when sending to Vendors

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 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10864
    flowe
    Participant

    Hy,
    Just purchased the Woocommerce Product Enquiry Form Plugin, works fine as long as I enter a single default email adress in my settings.

    But I really need the vendors to be notified – so I updated my functions.php with the code provided on the Woothemes documentation page to ensure WCVendor-support:
    ——————–
    add_filter( ‘product_enquiry_send_to’, ‘wc_product_enquiry_to_vendor’, 10, 2 );
    function wc_product_enquiry_to_vendor( $email, $product_id ) {
    $vendors = get_product_vendors( $product_id );
    if ( ! empty( $vendors ) ) {
    $emails = array();
    foreach( $vendors as $vendor ) {
    foreach( $vendor->admins as $admin ) {
    $emails[] = $admin->data->user_email;
    }
    }
    return $emails;
    }
    return $email;
    }
    —————–

    Unfortunately, this results in a Fatal Error:
    “Fatal error: Call to undefined function get_product_vendors() in /home/.sites/222/XXXXXXXXXX/web/wp/wp-content/themes/goodwork/functions.php on line 137”

    So far, I tried uncommenting my custom functions in my functions.php, deactivating multiple plugins, switching to a stock theme – but the error message always stays the same.
    Any idea how this can be fixed? Woosupport is clueless here.

    Any help would be greatly appreciated!

    #10871
    WC Vendors Support
    Participant

    Hi Flowe,

    The code that WooThemes has supplied you is for their Product Vendor plugin. Not WC Vendors. 🙂 You don’t need to do *anything* with WC Vendors, other than simply install Product Enquiry. We automatically detect it and route the emails to the vendor for vendor owned products. It’s as simple as it gets! 🙂 You should delete that functions.php code snippet entirely. 🙂

    Cheers,

    Ben

    #10938
    flowe
    Participant

    Hy Ben,
    Thank you so much for the info. it’s working now 🙂
    Just to clarify; should the default-email adress be left blank?
    Great help, thanks again!

    #10950
    WC Vendors Support
    Participant

    If you do not sell products yourself on your website, the default email can be blank. If you do sell products as the site admin on your website, then stick your email in there. 🙂

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