• Resolved JamesBoothroyd

    (@jamesboothroyd)


    Hi guys, I have tried myself with no avail so hoping you can help. I have narrowed it down to class-wcmp-email-vendor-new-order.php & tried to edit directly, nothing worked so then add something to my functions.php to add the billing name to the subject line but nothing I do seems to work.

    Can you kindly help on this one? Could the code below, found online, work with your hooks which I am unsure of?

    function skyverge_add_customer_to_email_subject( $subject, $order ) {
    $subject .= ' from ' . $order->billing_first_name . ' ' . $order->billing_last_name;
    return $subject;
    }
    add_filter( 'woocommerce_email_subject_new_order', 'skyverge_add_customer_to_email_subject', 10, 2 );

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi, thanks for reaching WCMp Support!!

    Please replace
    $order->billing_first_name . ' ' . $order->billing_last_name;

    with

    $order->get_billing_first_name(); and
    $order->get_billing_last_name();

    Hope this resolves the issue.

    Thread Starter JamesBoothroyd

    (@jamesboothroyd)

    Thanks for that. I have amended the code & re-added it to my functions.php file but we want it to amend the subject on the vendor-new-order email so the vendor can see the customer’s name.

    Here’s how the code in the functions.php reads…


    function skyverge_add_customer_to_email_subject( $subject, $order ) {
    $subject .= ' from ' . $order->get_billing_first_name(); $order->get_billing_last_name();
    return $subject;
    }
    add_filter( 'woocommerce_email_subject_new_order', 'skyverge_add_customer_to_email_subject', 10, 2 );

    Hi @jamesboothroyd, please install the new updated WC Marketplace from here -https://github.com/dualcube/dc-woocommerce-multi-vendor/archive/master.zip , we have resolved the email heading issue. Please make sure to remove the “master” tag from the file and then install that.

    Add the following code snippet for vendor new order email :

    add_filter( 'woocommerce_email_subject_vendor_new_order', 'skyverge_add_customer_to_email_subject', 10, 2 );

    Thread Starter JamesBoothroyd

    (@jamesboothroyd)

    Ahh, perfect; thanks!! I was using ‘WC_Email_Vendor_New_Order’ as I am no coder so tried to ‘wing it’ by taking a guess. Where does ‘woocommerce_email_subject_vendor_new_order’ come from?

    Modified working code from my functions.php should anyone else require it; sharing is caring!


    function skyverge_add_customer_to_email_subject( $subject, $order ) {
    $subject .= ' Customer: '.$order->billing_first_name.' '.$order->billing_last_name.'';
    return $subject;
    }
    add_filter( 'woocommerce_email_subject_vendor_new_order', 'skyverge_add_customer_to_email_subject', 10, 2 );

    Finally, the emails the vendor receive don’t provide much information. Do you have any suggestion either how the email the admin receives can be BCCd to the vendor or alternatively, provide the information to the vendor which is contained within the admins new order email? They need to be able to see customer name, address etc as we are selling tickets & they need to verify the information. Maybe a new template could be made for vendors with lines from the admin email?

    @jamesboothroyd, in order to achieve this flow, you can use any two of the below method :

    – Override the Vendor New Order email template and add the details as per your need.
    Or
    – In order add recipent to the order use this hook
    apply_filters( 'woocommerce_email_recipient_' . $this->id, $this->recipient, $this->object );

    Make sure to fetch the vendor_id from the product_id.

    Thread Starter JamesBoothroyd

    (@jamesboothroyd)

    Thanks for that, I’ll give it a go!

    We have your adaptive PayPal plugin installed but unfortunately it has never worked; it cannot send the IPN through to the website. I once commented on the plugin support, like this one, & you said a plugin could be blocking it but we managed to deactivate everything & it still did not work. We tried to change the IPN notification link but again that didn’t work (when I open up the log it shows the IPN link of https://www.mydomain.co.uk/wc-api/WCMp_PayPal_Adaptive_Payments_Gateway/) Entering this in to the browser returns IPN failure notice. You mentioned the link should be https://www.mydomain.co.uk/?wc-api=WCMp-PayPal-Adaptive-Payments-Gateway but this returns -1 in the browser.

    We are selling tickets which need to auto-send to the customer once paid for but the order currently sits there waiting to be completed. We’ve installed a Woo auto-complete plugin but it won’t fire as it is not registering a payment.

    Dualcube

    (@dualcube)

    @jamesboothroyd, The IPN notification link will always return (-1), if you access this via a browser. Only PayPal can access this link and send the response.

    We would also request you to verify whether the adaptive access is still working and activated.

    If the issue still exits, please get in touch with our support via – https://wc-marketplace.com/support-forum/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Customer name in email subject’ is closed to new replies.