Hello @yrj414,
Kindly open your wp-content/plugins/dokan/includes/wc-functions.php file and open this function dokan_get_more_products_from_seller
and now you can modify as you require inside the function to change content inside the tab.
Please note that if you modify into the core file then you will loose them during the plugin update. It’s better to do like below –
remove_action( 'woocommerce_product_tabs', 'dokan_set_more_from_seller_tab', 10 );
/**
* Set More products from seller tab
*
* on Single Product Page
*
* @since 2.5
* @param array $tabs
* @return int
*/
function dokan_set_more_from_seller_tab_new( $tabs ) {
if ( check_more_seller_product_tab() ) {
$tabs['more_seller_product'] = array(
'title' => __( 'More Products', 'dokan-lite' ),
'priority' => 99,
'callback' => 'dokan_get_more_products_from_seller_new',
);
}
return $tabs;
}
add_action( 'woocommerce_product_tabs', 'dokan_set_more_from_seller_tab_new', 11 );
/ Now I am writing the same function with a different function name and with custom content where I just changed the post per page number/
function dokan_get_more_products_from_seller_new( $seller_id = 0, $posts_per_page = 6 ) {
global $product, $post;
if ( $seller_id == 0 ) {
$seller_id = $post->post_author;
}
if ( ! abs( $posts_per_page ) ) {
$posts_per_page = 10;
}
$args = array(
'post_type' => 'product',
'posts_per_page' => $posts_per_page,
'orderby' => 'rand',
'post__not_in' => array( $post->ID ),
'author' => $seller_id,
);
$products = new WP_Query( $args );
if ( $products->have_posts() ) {
woocommerce_product_loop_start();
while ( $products->have_posts() ) {
$products->the_post();
wc_get_template_part( 'content', 'product' );
}
woocommerce_product_loop_end();
} else {
esc_html_e( 'No product has been found!', 'dokan-lite' );
}
wp_reset_postdata();
}
What I did is, remove the action and added the action with a new function name. Then changed the callback function and wrote a new function. If you are not a developer then you might not understand but you can try the above code or modifying it :)`
Note: You have to put those above codes on your child-theme’s functions.php file.