Hi @rsl89,
Vendors don’t download a digital product. Digital products’ downloadable files are downloaded by customers.
If you want them to download a limited-sized file, you need to upload a limited file size too.
However, if you want to limit the upload file size for vendors, you can add the following snippet at the bottom of your child theme’s functions.php file.
#-- Limit File Upload Size for Vendors --#
function limit_file_upload_size_for_vendors( $limit ) {
$user_id = get_current_user_id();
$user_meta = get_userdata($user_id);
$user_roles = $user_meta->roles;
if ( in_array( 'seller', $user_roles ) ) {
$limit = 2 * 1000000; // 2MB
}
return $limit;
}
add_filter( 'upload_size_limit', 'limit_file_upload_size_for_vendors' );
Thank you!