Forum
How to detect if user has no files
How can I run a conditional for a customer having no files.
At the moment the tag that outputs the files to the users account will not load if there are no products. So in the debug I can see it's not calling the file_list.html
due to the lack of files being present on the account. However, I would like to display to keep my layout balanced. Just a message to say something like, 'You have no files yet' etc.
I did try
if (perch_shop_purchased_files()) {
perch_shop_purchased_files([
'template' => 'products/files_list.html',
]);
} else{
echo("No files found");
}
Am I miles off on this thought process?
For products
I could be doing this the most inefficient way possible, but I arrived at a solution that appears to work.