Show vendor name on the single product page – Dokan Multivendor Plugin

Are you a Dokan Multivendor plugin user? If yes, then this tips can help you a lot. In another post of mine, I have described that how you can show vendor store name on product thumbnail. After publishing the post I got many requests to write another post at a similar point but this time the vendor name needs to show on the single product page.

To promote the vendor or to inform the customer about the vendor, the site admin always try to show the original owner of the product. On the single product page, there is a tab called “Vendor Information” to show vendor address, email etc. Nowadays, no one has the time to check each tab because everyone wants to save their time.

You are also thinking to add an option to the single product page description where the customer can view the original vendor who is selling the product. You are thinking to add an option to show  “Sold by: [store name]” on the single product page under the product summary.

How to show sold by tag on the single product page?

I found a quick solution to show vendor store name on the single product page. It is really quick and easy solution. Just open your child-theme functions.php file and add the below code :

After saving the file, just reload the single product page and you will be able to see the vendor store name on the single product page under the product summary.

I believe that this small tips can help you a lot. If you are not using Dokan plugin then you can take a look here.

Important Note

If you want to show Store name Instead of Vendor name then use the below code rather than the above one.

27 thoughts on “Show vendor name on the single product page – Dokan Multivendor Plugin

    1. Note: If you need to show store name instead of vendor name then you can replace the line number 18 with this line-Β 

      %s‘, $vendor->get_shop_url(), $vendor->get_shop_name() ); ?>

      1. Hi,

        I added this line, but it didn’t work, it shown “get_shop_url(), $vendor->get_shop_name() ); ?>” this line at the single product page. Is it something missing in this code?

        Thanks in advance.

      1. If its not that hard or time consuming for you, could you help me?
        Or send me a quote to my email and we can talk about this.

        I’m afraid Im a donkey looking at a palace when it comes to this stuff.

    1. It is possible but this is a totally different requirement rather than this blog topic. You have to add a button and then you have to get the store URL for the button πŸ™‚

  1. Hello,

    Really appreciate what you’ve shown us! Is there a way however to not show the above for specific vendor? I.e for the website owner?

  2. Your codes look great, but all codes I implement in the functions.php result in my website stating: “the website is dealing with technical problems”

    What am I doing wrong?

    1. Hello,

      Kindly make sure that you have inserted the code correctly and you did not miss any syntax. Also, if you can then turn on your debug to view the error.

  3. What I am doing wrong? I have copied the code in my php plugin (my-custom-functions) and all the time it brokes the page, I copy from 1 to the 18 but is still broken, what I’m doing wrong?

      1. Thank you so much, that was the reason why, so I think most of the people with problems is that they copy and paste the full code as you advised, but it should be just this:

        /*Show store name on single product*/
        add_action( ‘woocommerce_single_product_summary’, ‘seller_name_on_single’, 12 );
        function seller_name_on_single(){
        global $product;
        $seller = get_post_field( ‘post_author’, $product->get_id());
        $author = get_user_by( ‘id’, $seller );
        $vendor = dokan()->vendor->get( $seller );
        $store_info = dokan_get_store_info( $author->ID );
        if ( !empty( $store_info[‘store_name’] ) ) { ?>

        <?php printf( 'Vendido Por: %s‘, $vendor->get_shop_url(), $vendor->get_shop_name() ); ?>

        <?php
        }
        }

          1. I’m doing it right now cause it has been amazing, I love the way it looks now my site is:

            https://migrankiosko.com/producto/playstation-plus-membresia-de-3-meses-codigo-digital/

            I changed the word “Sold by:” to “Vendido Por:” cause I needed it in spanish, which looks amazing now.

            Hey I’m not sure if you can help me out with a thing inside Dokan, when a vendors creates a bulk discount it only shows the percentage, but most of the vendors will like an amount discount that a percentage, is there a way that can be done?

            Thanks

  4. Thank you for your help! I’d like to Show Vendor Name On The Single Product Page,
    but ABOVE the title of the product!

    Can you help me with the proper hook?

    THANKS SO MUCH!

Leave a Reply

Your email address will not be published. Required fields are marked *