DataMouse Posted May 29, 2008 Posted May 29, 2008 Hi all I have a store which is working great (www.datamouse.biz/catalog), and allows downloads from the store without issue. however, i would like to add an image next to the text for the order. When the download link is active, I would like to show one image - when inactive, another. I've had a look how the URL is constructed in download.php, but cannot figure out how to do this and have the image as a download link too. Can anyone help, please? Thanks DM I had a blind date last night. Her name was ..:. :.: :: .. ::. :. ::. Black Web 2.0 Buttons Blue Orb Web 2.0 Buttons Mac "Aqua" Buttons Black Gloss Buttons Red Gloss Buttons (with metal edging)
DataMouse Posted June 6, 2008 Author Posted June 6, 2008 Anyone? I had a blind date last night. Her name was ..:. :.: :: .. ::. :. ::. Black Web 2.0 Buttons Blue Orb Web 2.0 Buttons Mac "Aqua" Buttons Black Gloss Buttons Red Gloss Buttons (with metal edging)
germ Posted June 7, 2008 Posted June 7, 2008 MAKE A BACKUP If I understand what you want, the code in /catalog/includes/modules/downloads.php looks like this: <?php // The link will appear only if: // - Download remaining count is > 0, AND // - The file is present in the DOWNLOAD directory, AND EITHER // - No expiry date is enforced (maxdays == 0), OR // - The expiry date is not reached if ( ($downloads['download_count'] > 0) && (file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) && ( ($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) ) { echo ' <td class="main"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '</a></td>' . "\n"; } else { echo ' <td class="main">' . $downloads['products_name'] . '</td>' . "\n"; } ?> You'd need to alter it to something like: <?php // The link will appear only if: // - Download remaining count is > 0, AND // - The file is present in the DOWNLOAD directory, AND EITHER // - No expiry date is enforced (maxdays == 0), OR // - The expiry date is not reached if ( ($downloads['download_count'] > 0) && (file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) && ( ($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) ) { echo ' <td class="main"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . tep_image(DIR_WS_IMAGES . 'active.gif','Click to download') . '</a></td>' . "\n"; } else { echo ' <td class="main">' . tep_image(DIR_WS_IMAGES . 'inactive.gif','Download Unavailable') . '</td>' . "\n"; } ?> This code will display the image /images/active.gif as an active download link. And will display the image /images/inactive.gif if the link is inactive. Is that what you want? :unsure: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Recommended Posts
Archived
This topic is now archived and is closed to further replies.