Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"Download Page For Pending Downloads" problem.


greree

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This is exactly what I'm looking for - however, I'm still looking.

 

Any guidance on where I can find this contribution?

 

Cheers

 

Kenny

If you learn more than you forget then that's a good thing.

Link to comment
Share on other sites

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

If you learn more than you forget then that's a good thing.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

If you learn more than you forget then that's a good thing.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

If you learn more than you forget then that's a good thing.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

If you learn more than you forget then that's a good thing.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...