diff --git a/includes/wc-template.php b/includes/wc-template.php index 9b3b2d5410..4806fd3aab 100755 --- a/includes/wc-template.php +++ b/includes/wc-template.php @@ -1,4 +1,7 @@ get_id() ); - $author = get_user_by( 'id', $author_id ); - $store_info = dokan_get_store_info( $author->ID ); + if ( ! $product instanceof WC_Product ) { + return; + } + + $vendor = dokan_get_vendor_by_product( $product ); + if ( ! $vendor instanceof Vendor ) { + return; + } + + $store_info = $vendor->get_shop_info(); + $author = get_user_by( 'id', $vendor->get_id() ); dokan_get_template_part( 'global/product-tab', diff --git a/templates/global/product-tab.php b/templates/global/product-tab.php index 3a96c5150b..bd5a14770b 100644 --- a/templates/global/product-tab.php +++ b/templates/global/product-tab.php @@ -5,6 +5,9 @@ * @since 2.4 * * @package dokan + * + * @var WP_User $author Vendor user object + * @var array $store_info Vendor store data */ ?>