greree Posted February 2, 2003 Posted February 2, 2003 I installed a contribution called "Download Page For Pending Downloads" that puts a box on the default page indicating pending downloads. Clicking a button in the box takes you to the downloads page. That way customers don't have to navigate through My Account, etc. The only problem is when the downloads are finished the box stays on the page. The reason it stays is because it looks for a value in a field called "order_status" in the "orders" table in the database. When someone buys a downloadable product and pays with a check, the order status is set to 1, and the download isn't enabled, and the box doesn't appear on the default page. When I get the check, I set the order status to 2 to indicate processing. That tells the customer that I received the check and I'm waiting for it to clear the bank. When it clears I set the order status to 3, which tells the customer the download is available, downloads are enabled, and the box appears on the default page. When the customer clicks on the button in the box on the default page and downloads his product, the box stays. That's because the order_status field doesn't reset to 0. I can reset it manually, but that would be a pain. Anyone have any ideas on how to reset this value to 0 after the customer downloads the product or the time expires? Thanks for the help. Quote
Waza04 Posted February 2, 2003 Posted February 2, 2003 I have set this mod up myself and I cant be able to see your problem!! When the order is set the the downloadable status. is puts the box on and then that customer downloads it, the box wont go away until wither the ammount of max downloads has been reaced or the date on the download expires. Its best not to put the status back to one - because how ill you know when the customer has downloaded it or even know that it was successfull. I leave mine be, and wait for it automatically expire. Warren Quote
greree Posted February 2, 2003 Author Posted February 2, 2003 Then I either installed it wrong or it doesn't work quite right on a more recent snapshot. In my installation when max downloads is reached the link inside the box goes away, but the box itself stays. Inside the box is the text "Your Downloads". No link or button. I'll check it again. Quote
ezeman Posted February 9, 2003 Posted February 9, 2003 This is exactly what I'm looking for - however, I'm still looking. Any guidance on where I can find this contribution? Cheers Kenny Quote If you learn more than you forget then that's a good thing.
ezeman Posted February 9, 2003 Posted February 9, 2003 OOPS - found it. Quote If you learn more than you forget then that's a good thing.
ezeman Posted February 9, 2003 Posted February 9, 2003 Loaded OK but the script calls a couple of graphics which are not mentioned or included in the contribution. Obviously i can make my own but cant figure out where to put them - any ideas? Kenny Quote If you learn more than you forget then that's a good thing.
greree Posted February 9, 2003 Author Posted February 9, 2003 This is from a post the author made last September. forgot to mention, you gotta make two buttons button_to_download.gif button_archive.gif sorry about that guys.... oh, and they should go into catalog/includes/langauges/english/images/buttons You can change button_to_download.gif to button_download.gif in the code so you won't have to make that button. That's a standard osC button. Also, go to http://www.elbavarowebdesign.de/osc/catalo...ogue_button.htm. He's got a standard design button set that includes Archive. Look near the bottom. Oh, and do me a favor. When you test it out let me know how it works. I had to do a bit of tweaking to get it to work for me. Quote
Trusten Posted February 9, 2003 Posted February 9, 2003 color me really goofy but i think this is a box that i helped make. there is a bug in the box and there's not much to do to fix it. if this is in fact the box that i helped make, 1. did you email the maker? 2. did you email me? 3. if at ANY time, you deleted orders, or deleted members, especially deleted orders for one member in particular, THE BOX WILL NOT FADE FOR THAT PERSON. open a test account and do it yourself. archive the product, or use up all the downloads. however, if you delete any orders for that account you open, THE BOX, WILL NOT, GO AWAY. i don't know why it does this. but personally, i just never delete orders. i set them to cancel. *salutes* good luck. Quote
Trusten Posted February 9, 2003 Posted February 9, 2003 otherwise, it works great if you don't delete orders. Quote
greree Posted February 9, 2003 Author Posted February 9, 2003 Trusten, It is the box that you helped make. I fixed that problem. In your instructions to add code to column_right.php, add this line: AND opd.download_count > '0', so that it looks like this: if (tep_session_is_registered('customer_id')){ $downloads_query_raw1 = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, o.orders_id, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd WHERE customers_id = '" . $customer_id . "' AND o.orders_id = op.orders_id AND o.orders_status >= '2' AND o.orders_status != 99999 AND opd.download_count > '0' AND opd.archived != 'yes' AND opd.orders_products_id=op.orders_products_id AND opd.orders_products_filename<>'' ORDER BY opd.orders_products_download_id DESC LIMIT 999"; $download1 = tep_db_query($downloads_query_raw1); $download = tep_db_fetch_array($download1); if ($download > 0) { include(DIR_WS_BOXES . 'download_files.php'); } } That'll take care of the problem. The box goes away when it's supposed to. Quote
Trusten Posted February 10, 2003 Posted February 10, 2003 any chance you could help me with renaming files as they are saved onto the site from admin? Quote
ezeman Posted February 10, 2003 Posted February 10, 2003 Thanks greree - fix works wonders. Unfortunately, I found another bug in the downloads page. The list of downloads comes up fine and clicking on the file name gives us the file perfectly. Clicking on the file description, however, should take the customer to the info page about that product (product_info.php) but doesn't include the product_id (link shows "product_info.php?products_id=") so takes the user to a "product not found" message. I'm sure it's a simple fix but I'm no programmer, any ideas? Also - can anyone explain what archiving the file does? It seems to just disapear, why the customer might want to do this? Cheers Kenny Quote If you learn more than you forget then that's a good thing.
Trusten Posted February 10, 2003 Posted February 10, 2003 yeah, i got a fix for that. give me a sec. archive is if the person already downloaded the stuff, and has a few tries left but don't need it. they archive it. meaning take it off. but if it was an accident, they can just go to account, order info and do it the old fashion way. it's still there. Quote
greree Posted February 10, 2003 Author Posted February 10, 2003 I fixed the product id bug, too. If Trusten doesn't post in a while I'll post it. I should have posted an update on the contributions page, as well as one for my own contribution. I've been lazy. Sorry. Quote
ezeman Posted February 10, 2003 Posted February 10, 2003 Thanks I use Worldpay for my credit card clearing and allow customers to phone in their CC Number or send me a cheque. The restrictions work perfectly (apart form the links bug) in the download box & page. Exellent!! If I add the same restricting code as in the info box to my downloads.php will I be able to restrict the downloads on "view orders" that still have status of 1? I haven't tried the Download Controller contribution because it has a php file for each of the payment types and worldpay is an additional contribution which isn't covered. Cheers Kenny Quote If you learn more than you forget then that's a good thing.
greree Posted February 10, 2003 Author Posted February 10, 2003 Trusten, who were you asking about renaming files? Quote
Trusten Posted February 10, 2003 Posted February 10, 2003 find this (should be the second set of code // Now get all downloadable products in that order $downloads_query_raw = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, o.orders_id, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays Replace with // Now get all downloadable products in that order $downloads_query_raw = "SELECT DATE_FORMAT(date_purchased, '%Y-%m-%d') as date_purchased_day, o.orders_id, opd.download_maxdays, op.products_name, op.products_id, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays the op.products_id was missing from that code. Quote
ezeman Posted February 10, 2003 Posted February 10, 2003 Spot on Trusten, thanks There were 2 instances of the select statement (still don't have enough of a grip of this to know why) and just one of them had op.products_id missing. Quote If you learn more than you forget then that's a good thing.
Trusten Posted February 10, 2003 Posted February 10, 2003 well, there is a different page, that's why. it's probably not needed but i'd have to look it over to see if it is. each time i've tried to do any major editing on the code, bad things happen. LOL sorta. Quote
greree Posted February 10, 2003 Author Posted February 10, 2003 Trusten, OK, what exactly is the problem? I'm not an expert in PHP or MySQL. I work things out by .... well, I'm not exactly sure how I work things out. Sometimes I just do. Quote
Trusten Posted February 10, 2003 Posted February 10, 2003 oh good. i'll take what i can get. i have this form, it's suppose to allow members to upload their files. right? problem is, you know how in the adin area, if you have a pic named pic1.jpg, and you upload A DIFFERENT pic named pic1.jpg, it overwrites it? i want it so that it adds a date stamp onto the file that's being uploaded, so it reads M-D-Y (month day year) M-D-Y-pic1.jpg it won't be flawless, but it'll help. anyhow, i want it so that it adds words onto the file name when it saves it, and when it enters it into the database. think you can help? Quote
greree Posted February 10, 2003 Author Posted February 10, 2003 I'll see what I can do. If it's possible, I'll figure it out. Think of it as payment for your downloads contribution. Give me a day or two. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.