Forums / General Questions / Upload script during checkout

Upload script during checkout

Locked

Views: 3,132

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
17 Dec 2007, 12:52 AM
#1
onelove5683 avatar

onelove5683

New Zenner

Join Date:
Apr 2007
Posts:
77
Plugin Contributions:
0

Upload script during checkout

Is there any way to add a feature to allow the customer to upload a file during their checkout?

For example, if my site is for an image modification service, the customer will select the service they want to purchase, check-out, and upload their original image during the checkout process or immediately after.

I know they can just "email it to me" after they pay for the service, but that is no good! I need the file to be uploaded as soon as they pay. Also, it would be great if the files could be associated with their account.

Is there any way to do this? Or would someone be interested in making this work?

Please please please help. Thanks!

17 Dec 2007, 2:10 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upload script during checkout

Add a FILE attribute, and they can upload it when the add the service to their cart.
https://www.zen-cart.com/tutorials/index.php?article=57

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Dec 2007, 2:51 PM
#3
onelove5683 avatar

onelove5683

New Zenner

Join Date:
Apr 2007
Posts:
77
Plugin Contributions:
0

Re: Upload script during checkout

I read that page, and I went in to try it out. I think I'm missing something. Can you kinda do a step by step?

Where does the file go when they upload it?

18 Dec 2007, 12:19 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upload script during checkout

The FILE Option Type for attributes is discussed on page 181 of the eStart Your Web Store With Zen Cart user's manual.

Simply choose FILE for the Option Type when setting up the attribute components, and the customer will see a box to enter the name of the file they wish to upload from their computer. It's not really much different from using a TEXT Option Type to allow input of words, or a DROPDOWN Option Type to allow selection from a few possible choices via a pulldown menu.

The files are uploaded to the /images/uploads folder on your server, whose permissions need to be set to Writable (ie: usually 777). The files will be renamed numerically, for the protection of your server and hosting account, so that people cannot upload rogue files and arbitrarily execute them.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Dec 2007, 4:27 AM
#5
onelove5683 avatar

onelove5683

New Zenner

Join Date:
Apr 2007
Posts:
77
Plugin Contributions:
0

Re: Upload script during checkout

Thank you for your help.

What if the file is of a different type? I keep getting this message:
"Error: File type not allowed. - jpg,jpeg,gif,png,eps,cdr,ai,pdf,tif,tiff,bmp,zip"

19 Dec 2007, 5:10 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Upload script during checkout

Also explained on page 181 of the eStart Your Web Store With Zen Cart user's manual, is the fact that you can set allowed file types in Admin->Configuration->Maximum Values->Allowed Filename Extensions for uploading

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Mar 2008, 6:49 AM
#7
onelove5683 avatar

onelove5683

New Zenner

Join Date:
Apr 2007
Posts:
77
Plugin Contributions:
0

Re: Upload script during checkout

Thank you thank you thank you!

I got it all figured out, works great...

but the files that are uploaded to images/uploads are appearing as:
"images/uploads/1.jpg"
"images/uploads/2.jpg"
etc...

I need the file names to be the same as the ones the customer uploads so that I can match it to their order. This is very important.

18 Mar 2008, 4:17 PM
#8
papadopoulos avatar

papadopoulos

New Zenner

Join Date:
May 2006
Posts:
14
Plugin Contributions:
0

Re: Upload script during checkout

onelove5683:

Also, it would be great if the files could be associated with their account.

DrByte,

I am so glad to have found this post.

So, is the uploaded image associated with an order? That would be great.

Is the uploaded-by-the-customer image stored in the database and is it retrievable from the order management page in admin?

Thank you,
P

18 Mar 2008, 5:17 PM
#9
onelove5683 avatar

onelove5683

New Zenner

Join Date:
Apr 2007
Posts:
77
Plugin Contributions:
0

Re: Upload script during checkout

papadopoulos:

So, is the uploaded image associated with an order? That would be great.

Is the uploaded-by-the-customer image stored in the database and is it retrievable from the order management page in admin?

Thank you,
P
Hi, I can answer that question for you.

The customer can have the ability to upload any type of file extension that you allow in admin/config/max values/"Allowed Filename Extensions for uploading"

When the image is uploaded to the server by the customer, it is stored in images/uploads and is ordered by numbers. For example: "1.jpg" "2.gif"

If you go to admin/customers/orders you can see the name of the file that the customer uploaded, but there doesn't seem to be any way to retrieve the file from admin, you would have to use FTP.

I was hoping that it would become numbered as well as keep the customers original filename when they are uploaded to the images/uploads directory. Fortunately enough, the number that is applied to the filename in the images/uploads folder matches the number applied to the filename in the Orders section of admin.

18 Mar 2008, 5:26 PM
#10
papadopoulos avatar

papadopoulos

New Zenner

Join Date:
May 2006
Posts:
14
Plugin Contributions:
0

Re: Upload script during checkout

onelove,

Thank you very much,
P

9 May 2008, 4:21 PM
#11
nightwolff avatar

nightwolff

New Zenner

Join Date:
Dec 2006
Location:
Ohio
Posts:
16
Plugin Contributions:
0

Re: Upload script during checkout

I would also love it if the filename uploaded was like 5_name.jpg to preserve the customer's filename and make it easier to browse when you don't have the order form handy. Is there something in upload.php that can be changed to append the # but keep the name too?

-Shawn

www.flagladyohio.com
Zen Cart v1.38a, Installed mods: - Css Flyout Menus - Gallery Categories - Google Analytics by Andrew - Ultimate SEO URLs - Custom Imagebox by cshart