Home › Forums › WoodMart support forum › sold by
sold by
- This topic has 5 replies, 3 voices, and was last updated 5 years, 7 months ago by kindergraff.
-
AuthorPosts
-
April 15, 2019 at 11:39 pm #119017
kindergraffParticipantCan 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.April 16, 2019 at 7:36 am #119049
Elise NoromitMemberHello,
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
April 16, 2019 at 12:30 pm #119110
jodyshopParticipantHello, 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:
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/April 16, 2019 at 1:55 pm #119133
Elise NoromitMemberHello,
Thank you very much for sharing the information, hope it would be helpful.
Best Regards
April 16, 2019 at 2:37 pm #119160
jodyshopParticipantThank you, Elise, yes hope so too 🙂
April 20, 2019 at 8:48 pm #120107
kindergraffParticipantHello,
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.:PThank you again.
-
AuthorPosts
Tagged: Dokan plugin, fashion store, jodyshop, Jodyshop Store, sell on Jodyshop, Sell Online, Shopping, Vendor Store, Woodmart theme
- You must be logged in to create new topics. Login / Register