Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Require Customer To Login For Edp Downloads. Rate Topic   - - - - -

 
  • jeffshead
  • Member
  • Members
  • Join Date: 15-May 08
  • 120 posts

Posted 01 December 2016 - 04:30 AM #1

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:

 

controllers\customer\orders.php

 

From (around line 401):

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

To:

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.


CS-Cart 4.6.3 SP1