Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

FTP uploading corresponding to Order #


betterbannerprinting@yahoo.com

Recommended Posts

Hello forum! Here is a tricky one and I would appreciate any input from the community.

 

Basically we are using osCommerce and have a simple item structure, nothing horribly fancy. We want to provide a way for customers to upload an image/images to our FTP server when they are checking out. We've been able to achieve something close to this by including an upload option (in the form of a link leading to a simple FTP upload form) under item details. Here's the tricky part... we want either the file name, a system created directory name, or a system created info file that corresponds to the Order number! In other words, when we have many many orders in a day with many many uploads, we want a way to decypher which uploads went to which order (and perhaps even which items within the order). I'm assuming this uploading process would then have to be done during checkout.

 

Any suggestions? I was searching for a module that does this but didn't find anything. This is an extremely important function for us and we are just stuck.

 

Thanks so much guys!

Link to comment
Share on other sites

Hello forum! Here is a tricky one and I would appreciate any input from the community.

 

Basically we are using osCommerce and have a simple item structure, nothing horribly fancy. We want to provide a way for customers to upload an image/images to our FTP server when they are checking out. We've been able to achieve something close to this by including an upload option (in the form of a link leading to a simple FTP upload form) under item details. Here's the tricky part... we want either the file name, a system created directory name, or a system created info file that corresponds to the Order number! In other words, when we have many many orders in a day with many many uploads, we want a way to decypher which uploads went to which order (and perhaps even which items within the order). I'm assuming this uploading process would then have to be done during checkout.

 

Any suggestions? I was searching for a module that does this but didn't find anything. This is an extremely important function for us and we are just stuck.

 

Maybe I am missing something here .................... just use the order id

 

When the user hits Submit/Upload, why not just do a db query on the order ?

If you need to run this simutaneously as teh order confirmation, then you could :1

1. insert the order.

2. query for the order number

you could modify the order class from the /includes/classes/orders file :

3. here is your element : (int)$order_id

Link to comment
Share on other sites

Maybe I am missing something here .................... just use the order id

 

When the user hits Submit/Upload, why not just do a db query on the order ?

If you need to run this simutaneously as teh order confirmation, then you could :1

1. insert the order.

2. query for the order number

you could modify the order class from the /includes/classes/orders file :

3. here is your element : (int)$order_id

 

Aren't order numbers generated after the submission process is complete? How then could the upload form query for an order number that hasn't been generated yet? I didn't even think about having the upload form come up after the order was submitted, and wonder if it is even possible.

Link to comment
Share on other sites

Aren't order numbers generated after the submission process is complete?

 

Well - Yes and no. The order is inserted in the orders table - and the orders_id is auto generated.

 

So - you can either modify the existing function, or you can can do your own select orders_id from orders where date_purchased = <###> and customers_id = <###>

 

Then the php can keep going, and rename the uploaded file to match the orders_id id.

 

 

I didn't even think about having the upload form come up after the order was submitted, and wonder if it is even possible.

 

Yes - this would be more simple.

Have the user confirm the order.

Order goes through successfully.

The browser returns a single input box and button that says 'Upload file'.

You already have the order_id in your POST from the confirmation page.

User selects his file locally, hit upload.

On submit, the file gets uploaded onto your server into a predetermined directory, and renamed to the orders_id.

 

The only "issue" I see with this is - if you wanted the user to have "access" to his uploaded file, then you may want to submit 2 confirmation emails - which may be annoying to the user.

Also - what if the order is placed successfully, but the uploaded file fails for whatever reason ???

Will this mean that _everything_ fails and you need to rollback the previous transaction ? will you accept it anyway ? what if you only send out a confirmation email after a successful upload ??

 

there are many error checking and failure vulnerabilities that can pose a risk to you and your clients.

 

Without knowing WHY you want to do what you want to do, I can only make guesses and assumptions as to what method is best for you.

 

david in ottawa

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...