Zen Cart Logo
Forums / Basic Configuration / Downloadbutton remains available after payment and download file.

Downloadbutton remains available after payment and download file.

Views: 843

Results 1 to 1 of 1
5 Jan 2025, 9:08 PM
#1
dirks avatar

dirks

New Zenner

Join Date:
Sep 2024
Location:
Noord Holland
Posts:
24
Plugin Contributions:
4

Downloadbutton remains available after payment and download file.

Hello,

I think there is a small issue in the file tpl_modules_downloads.php :

Because after downloading a file (set to 1 time download) I could still download the file until I refresh the screen.
I didn't want this so I changed line 66 in: includes/templates/template_default/templates/tpl_modules_downloads.php

from:

 <td class="downloadButton centeredContent"><?php echo ($file['is_downloadable']) ? '<a href="' . $file['link_url'] . 
   '" download="' . $file['filename'] . '">' . zen_image_button(BUTTON_IMAGE_DOWNLOAD, BUTTON_DOWNLOAD_ALT) . '</a>' : ' '; ?>
</td>    to:
    

  <td class="downloadButton centeredContent" **onclick="location.reload()"**><?php echo ($file['is_downloadable']) ? '<a href="' . $file['link_url'] . 
      ' " download="' . $file['filename'] . '">' . zen_image_button(BUTTON_IMAGE_DOWNLOAD, BUTTON_DOWNLOAD_ALT) . '</a>' : ' '; ?>
 </td>

After this change, everything will be updated immediately.

Dirk