This topic contains 4 replies, has 3 voices, and was last updated by  jodyshop 3 days, 10 hours ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #119017

    kindergraff
    Customer

    Can i have a “sold by…” text on my products, using the Dokan plugin? I want “sold by…” text to be visible in category page, for example, under each product.
    Thank you.

    #119049

    Hello,

    Please refer the Docan documentation or the plugin support on the issue. Our theme does not influence on Docan plugin functionality and options.

    Best Regards

    #119110

    jodyshop
    Advanced consultant

    Hello, my dear @kindergraff and my dear staff team @Elise
    Thank you both for asking such a question.

    Actually, it’s very easy to achieve such action, simply you can copy and paste this snippet of code to the Woodmart child theme function.php

    /*
    Show Seller name on the product thumbnail
    For Dokan Multivendor plugin 
    */
    
      add_action( 'woocommerce_after_shop_loop_item_title','sold_by' );
        function sold_by(){
        ?>
            </a>
            <?php
                global $product;
                $seller = get_post_field( 'post_author', $product->get_id());
                 $author  = get_user_by( 'id', $seller );
    
                $store_info = dokan_get_store_info( $author->ID );
                if ( !empty( $store_info['store_name'] ) ) { ?>
                        <span class="details">
                            <?php printf( 'Sold by: <a href="%s">%s</a>', dokan_get_store_url( $author->ID ), $author->display_name ); ?>
                        </span>
                <?php 
            } 
    
        }

    The results will be:
    Jodyshop show sold by

    multi-vendors sold by Jodyshop

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

    <?php printf( 'Sold by: <a href="%s">%s</a>', $vendor->get_shop_url(), $vendor->get_shop_name() ); ?>

    Please test it live here on my website that uses: Woodmart theme.
    https://www.jodyshop.com/

    • This reply was modified 3 days, 12 hours ago by  jodyshop. Reason: adding more images to showcase
    #119133

    Hello,

    Thank you very much for sharing the information, hope it would be helpful.

    Best Regards

    #119160

    jodyshop
    Advanced consultant

    Thank you, Elise, yes hope so too 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.