Support » Plugin: Dokan - Best WooCommerce Multivendor Marketplace Solution - Build Your Own Amazon, eBay, Etsy » Showing vendor’s address in the invoice mail for admin only

  • Resolved faisal95bd

    (@faisal95bd)


    Hi,
    When a customer places an order, the customer, and the admin both receive an invoice copy in their email.

    Now, just for admin invoice email, I want to show the vendor’s address too. I’ve added the following code; but it’s showing the vendor’s address in both admin & customer’s invoice copy. I just want to show it for admin only.

    
    /**
    * Sending Vendor's Address With Order's Invoice
    */
    #-- Display vendor address as a 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 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Tanjir Al Mamun

    (@tanjiralmamun)

    Hi @faisal95bd,

    We really appreciate your effort. But investigating a custom code is beyond our support policy.

    If you’re unable to find a solution, kindly contact a developer for help.

    Thank you,

    Thread Starter faisal95bd

    (@faisal95bd)

    This custom code was provided by you!

    Plugin Support Tanjir Al Mamun

    (@tanjiralmamun)

    Hi @faisal95bd,

    We share a custom code if there has any readymade solution that has been contributed by any Dokan users in the forum. So, you maybe got the code in the same way.

    But we’re unable to provide the custom solution that you’re looking for.

    I hope you got it.

    Thank you,

    Thread Starter faisal95bd

    (@faisal95bd)

    Such a waste of time.

    Close or remove this thread…

    Plugin Support Tanjir Al Mamun

    (@tanjiralmamun)

    Hi @faisal95bd,

    Thanks for your feedback. Since you’ve got the answer to your query, so I’m closing this thread.

    Feel free to create a new thread if you have any further queries in the future.

    Have a great day!

    Best Regards,`

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.