Require Customer To Login For Edp Downloads

It's been a long time since I've messed with CS-Cart. I finally got around to updating a store from 3.0.x to 4.4.x.

The code has really changed. In version 3.0.x, I edited the following code to force users to be logged in to download EDP products that they've purchased:


From (around line 401):

if (($field == 'file_path' && !empty($_REQUEST['ekey']) || $field == 'preview_path')) {


if ((isset($auth['user_id']) && $auth['user_id'] != 0 && $field == 'file_path' && !empty($_REQUEST['ekey']) || $field == 'preview_path')) {
	// Uncomment below if you do NOT want to require user's to be logged in to download files
	// if (($field == 'file_path' && !empty($_REQUEST['ekey']) || $field == 'preview_path')) {

Can this still be done in 4.4.x? If so, what code needs to be edited. I just can't find it :?

One reason that I want to do this is because customer's that are not logged in, are being taken to the store homepage when they click on the download link in the download emails.

I would like a login prompt displayed when a download link in an email is clicked, then have the user redirected to the protected download page or have the download start once login has been completed.