From 657c6118cd269e3f29c2cddb3271e530809af7e3 Mon Sep 17 00:00:00 2001 From: Sabbir Ahmed Date: Fri, 15 Sep 2023 09:38:06 +0000 Subject: [PATCH 1/3] Display no vendor found in case of author not found and return boolean false rather than user object --- includes/wc-template.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/includes/wc-template.php b/includes/wc-template.php index f602ad8..a26ef88 100755 --- a/includes/wc-template.php +++ b/includes/wc-template.php @@ -52,10 +52,18 @@ function dokan_product_seller_tab( $val ) { $author = get_user_by( 'id', $product->post->post_author ); $store_info = dokan_get_store_info( $author->ID ); - dokan_get_template_part('global/product-tab', '', array( - 'author' => $author, - 'store_info' => $store_info, - ) ); + if ($author) { + dokan_get_template_part( + 'global/product-tab', + '', + [ + 'author' => $author, + 'store_info' => $store_info, + ] + ); + } else { + echo "No vendor information found!"; + } } From f7e83792262a7515143c173ba27b4de680615f39 Mon Sep 17 00:00:00 2001 From: Sabbir Ahmed Date: Fri, 15 Sep 2023 12:13:59 +0000 Subject: [PATCH 2/3] Initial commit From b424bdad7337fda02249b4c55cd8fb4ed5dea240 Mon Sep 17 00:00:00 2001 From: Sabbir Ahmed Date: Fri, 15 Sep 2023 14:28:46 +0000 Subject: [PATCH 3/3] Display no vendor found in case of author not found and retrun boolean false rather than use object --- includes/wc-template.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/wc-template.php b/includes/wc-template.php index a26ef88..d904f87 100755 --- a/includes/wc-template.php +++ b/includes/wc-template.php @@ -50,9 +50,10 @@ function dokan_product_seller_tab( $val ) { global $product; $author = get_user_by( 'id', $product->post->post_author ); - $store_info = dokan_get_store_info( $author->ID ); if ($author) { + $store_info = dokan_get_store_info( $author->ID ); + dokan_get_template_part( 'global/product-tab', '',