If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Attach a filename from the checkout page and carry it through to the back end

Attach a filename from the checkout page and carry it through to the back end

Started by crusader12 on 27 Aug 2011, 10:48 PM · Views: 917

Results 1 to 8 of 8
27 Aug 2011, 10:48 PM
#1
crusader12 avatar

crusader12

New Zenner

Join Date:
Aug 2011
Posts:
4
Plugin Contributions:
0

Post #1 by crusader12

Hi,
Fairly new to Zencart and loving it so far. I'm working on an apparel site which offers custom design along with their shirts. I'm running version 1.3.9 and the link is prothings.com/store

After purchasing a shirt and selecting the custom design option, an artwork uploader is generated on the Checkout page. I've used javascript to pull the file names of the uploaded files and place them into the correct orders at the end of the unordered list of price attributes.

Everything works correctly (still a few minor bugs), but when proceeding on to the other checkout steps the artwork file names drop off. Is there any way to keep these names intact and carry them through the rest of the checkout process and eventually onto the order in the admin?

Thanks!

28 Aug 2011, 2:06 AM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,758
Plugin Contributions:
0

Post #2 by Kim

Why aren't you using the built in upload attribute?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

28 Aug 2011, 3:42 PM
#3
crusader12 avatar

crusader12

New Zenner

Join Date:
Aug 2011
Posts:
4
Plugin Contributions:
0

Post #3 by crusader12

Hi, I'm not using the file upload attribute for a couple of reasons:

  1. I require multiple files to be uploaded for each product (an unknown number of files)

  2. If artwork/design is chosen, then this becomes a required field (from the forums I've discovered you can't really make this a required field)

For those 2 reasons I've had to integrate the uploader outside of the ZenCart attributes. At this point they are now required for orders that need artwork and provide a way to name files according to the order name as well as make these required before proceeding to the checkout (by simply showing the cart checkout button once artwork is assigned to an order). I've purchased the ZC manual and read it as well as searching both the forums and google and believe this to be the best method for what I need on this site. The ZC file upload field just wasn't cutting it...

28 Aug 2011, 6:09 PM
#4
drbyte avatar

drbyte

Sensei

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

Post #4 by drbyte

If you set your custom upload code to insert the selected filename and other information that you want added as attributes, then the data will pass thru to the order as attribute data. If you don't, then ... it won't.

.
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.

28 Aug 2011, 8:03 PM
#5
crusader12 avatar

crusader12

New Zenner

Join Date:
Aug 2011
Posts:
4
Plugin Contributions:
0

Post #5 by crusader12

Sorry, I'm not following you when you say:

"If you set your custom upload code to insert the selected filename and other information that you want added as attributes, then the data will pass thru"

How would I go about doing this?

I cannot use a price attribute for the uploader due to the reasons I listed earlier, so I'm stuck trying to dynamically add the information to the form from the cart checkout page using jquery....
Thanks!

28 Aug 2011, 8:25 PM
#6
drbyte avatar

drbyte

Sensei

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

Post #6 by drbyte

Well, since you're not using the normal method of linking filenames at the time of add-to-cart, you're going to have to get creative with a way to update the cart contents long after it's already been set, ie: once your uploader tool does its magic. You'll need to study the shopping cart class and see how it stores the information, and work up your own way to inject the additional required entries.

And you'll probably need to create (otherwise unused) attributes for it to link to, else the database relationships won't match and thus the records will be excluded from the joins and thus won't show.

.
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.

28 Aug 2011, 10:24 PM
#7
crusader12 avatar

crusader12

New Zenner

Join Date:
Aug 2011
Posts:
4
Plugin Contributions:
0

Post #7 by crusader12

Ahhhh, this would be much easier if zc supported multiple file uploads with required fields....

28 Aug 2011, 10:47 PM
#8
drbyte avatar

drbyte

Sensei

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

Post #8 by drbyte

You could always simply code it to make them required fields, if that's the real goal you have in mind.
And share the code back to the community so others can benefit from it after you.

.
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.