Home Forums WoodMart support forum sold by

sold by

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

    kindergraff
    Participant

    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
    Participant

    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/

    #119133

    Hello,

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

    Best Regards

    #119160

    jodyshop
    Participant

    Thank you, Elise, yes hope so too 🙂

    #120107

    kindergraff
    Participant

    Hello,
    thank you jodyshop for the very quick answer. I tried with the code. Unfortunately it didn’t work. I don’t know much about coding so I might have done something wrong. So I opted for another multivendor plugin (WCMarketplace) (mostly due to other features i needed).
    And I still have the same problem.:P

    Thank you again.

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