• Resolved niikk

    (@niikk)


    Hello

    We want to display the vendor store name of the order in the order completed mail. So if it is a multivendor order, the the customer have the info also in the email subject.

    This is our current code:

    /**
     * @snippet       Add Billing First_name to Email Receipt (Customer Processing Mail)
     */
    
    add_filter( 'woocommerce_email_subject_customer_processing_order', 'change_processing_email_subject', 1, 2 );
    
    function change_processing_email_subject( $subject, $order ) {
    global $woocommerce;
    
    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    
    $subject = sprintf( '%s, Danke für Deine Bestellung (#%s) bei %s!', $order->billing_first_name, $order->get_order_number(), $blogname );                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
    return $subject;
    }

    Now we want to add the vendor store name. For taht we try to get the name of the vendor storename and output the value with $shop_name.

    $order->get_items();       
     // Author id
     $author_id = $product->post->post_author;
            
     // Shopname
     $vendor = dokan()->vendor->get( $author_id );
     $shop_name = $vendor->get_shop_name();

    Then a output like that.. but taht does not work…

    $subject = sprintf( '%s, Danke für Deine Bestellung (#%s) bei %s! Vendor: %s', $order->billing_first_name, $order->get_order_number(), $blogname, $store_name );                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
    return $subject;
    }

    How can we get the Vendor store name of the order?

    • This topic was modified 3 years, 9 months ago by niikk.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Show Vendor storename in mail subject’ is closed to new replies.