How can I send vendor’s address to the invoice email for admin only
-
I have got a multi-vendor store in WooCommerce with Dokan Pro.
Now, when an order is placed I want to send the vendor’s address in the invoice email too. But I want to send the address to the invoice email for admin only.
I tried to contact the Dokan support team: they’ve given me a snippet. But it sends the vendor’s address to the customer’s invoice email too. That’s the snippet below:
// Display vendor address as an order meta remove_action( 'woocommerce_order_item_meta_start', 'dokan_attach_vendor_name', 10, 2 ); function attach_vendor_info($item_id, $order){ $product_id = $order->get_product_id(); if ( ! $product_id ) { return; } $vendor_id = get_post_field( 'post_author', $product_id ); $vendor = dokan()->vendor->get( $vendor_id ); if ( ! is_object( $vendor ) ) { return; } $store_address = dokan_get_seller_short_address( $vendor->get_id(), false ); printf( '<br>%s: <a href="%s">%s</a> <p style="font-weight: inherit">%s</p>', esc_html__( 'Vendor', 'dokan-lite' ), esc_url( $vendor->get_shop_url() ), esc_html( $vendor->get_shop_name() ), $store_address ); } add_filter('woocommerce_order_item_meta_start', 'attach_vendor_info', 10, 2);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How can I send vendor’s address to the invoice email for admin only’ is closed to new replies.