Cyber2000, on Nov 12 2005, 08:58 PM, said:
CODE
// Check that order_id, customer_id and filename match
$downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . $customer_id . "' and o.orders_id = '" . (int)$HTTP_GET_VARS['order'] . "' and o.order_status = '3' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != ''");
This code should only allow the d/l if the order is set to delivered. so in admin control panel, if you click on the customer orders and then set the order from pending to delivered, the customer ONLY then will be allowed to click the link and download their order.
This STOPS ALL customer from sttealing your downloads by using the test credit card number (which I wont display even you know it as it is not fair).
Now my problem is about my download link. Although the script given gives me the capability to hold downloads until the order is set to delivered. I still have the link to download the file even though it is still set to pending, however it does not allow me to download the file when i click on the link, it just gives me a blank page. a link somewhat like this: catalog/download.php?order=8&id=9
What i want is to have the download link grayed out / not clickable or even not viewable when the download is still set at pending state, and only enabled/viewed when the download is in delivered state.














