Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Custom form fields on Product Page

Custom form fields on Product Page

Views: 1,312

Results 1 to 16 of 16
10 Aug 2011, 4:32 PM
#1
jfenn avatar

jfenn

New Zenner

Join Date:
Jun 2008
Posts:
19
Plugin Contributions:
0

Custom form fields on Product Page

I would like to have a form on the product page that customers can fill out and add an attachment to.

What I want is several different fields, such as:

Name
Birth Date
Weight
Time
Welcomed By

Then I want a place that they can upload 1-4 pictures.

I'm doing custom birth announcements and would like to have this right on my product page so it's easier for my customers.

I've searched all over this board, the tutorials, & the mods, and can't seem to find anything that will do this. I found a site that is similar to what I want and that was done with Zen.

Can anyone tell me how to do this or if there's a mod that will allow me to do this?

Thanks

10 Aug 2011, 5:22 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Custom form fields on Product Page

You can add all those as custom fields to your product using built-in attribute support.
https://www.zen-cart.com/tutorials/index.php?article=57

10 Aug 2011, 5:47 PM
#3
jfenn avatar

jfenn

New Zenner

Join Date:
Jun 2008
Posts:
19
Plugin Contributions:
0

Re: Custom form fields on Product Page

DrByte:

You can add all those as custom fields to your product using built-in attribute support.
https://www.zen-cart.com/tutorials/index.php?article=57

Thank you. I looked at that tutorial but I guess I didn't understand what it was talking about. I've done zen carts before but never did much with attributes.

I'm confused on where I would add my custom field and where to add the place that I can have an attachment uploaded to the form. I see the part that says "Attribute required for Text" but I don't exactly know how to use that.

Do I need to set up the option names/values in a certain way in order for this to work?

I'm sorry for sounding so dumb.

10 Aug 2011, 5:52 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Custom form fields on Product Page

Yes, you need to create option names and values, which define the fields your customers will fill in.
For fields where they type, use "Text" as the choice.
And for uploading files, those would be "File" as the choice.

10 Aug 2011, 6:07 PM
#5
jfenn avatar

jfenn

New Zenner

Join Date:
Jun 2008
Posts:
19
Plugin Contributions:
0

Re: Custom form fields on Product Page

DrByte:

Yes, you need to create option names and values, which define the fields your customers will fill in.
For fields where they type, use "Text" as the choice.
And for uploading files, those would be "File" as the choice.

I have figured most of it out but am having a few issues. It is saying [was: +$0.00 now is: Free] after each box. How do I get rid of that?

Also, Is there a way to add a comment-type box so that people can add more information if needed (like a place where they can add a message up to 500 characters)?

10 Aug 2011, 6:10 PM
#6
jfenn avatar

jfenn

New Zenner

Join Date:
Jun 2008
Posts:
19
Plugin Contributions:
0

Re: Custom form fields on Product Page

Also, where do I find the files that have been uploaded?

10 Aug 2011, 6:18 PM
#7
drbyte avatar

drbyte

Sensei

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

Re: Custom form fields on Product Page

Comments can be a text field that you've set to more than just 1 line.
Uploaded files will go into your /images/uploads folder, and will be named according to the order number.

10 Aug 2011, 6:29 PM
#8
jfenn avatar

jfenn

New Zenner

Join Date:
Jun 2008
Posts:
19
Plugin Contributions:
0

Re: Custom form fields on Product Page

DrByte:

Comments can be a text field that you've set to more than just 1 line.
Uploaded files will go into your /images/uploads folder, and will be named according to the order number.

Thank you so much for your help!

One more question:

How do I get rid of [was: $0.00 now is: Free] after every box?

10 Aug 2011, 6:41 PM
#9
jfenn avatar

jfenn

New Zenner

Join Date:
Jun 2008
Posts:
19
Plugin Contributions:
0

Re: Custom form fields on Product Page

jfenn:

Thank you so much for your help!

One more question:

How do I get rid of [was: $0.00 now is: Free] after every box?

Nevermind, I've figured it out. If there's a price on the product it doesn't do that...:oops:

Sorry for bothering you.

I've got everything set up correctly now :clap:

13 Aug 2011, 2:43 AM
#10
jfenn avatar

jfenn

New Zenner

Join Date:
Jun 2008
Posts:
19
Plugin Contributions:
0

Re: Custom form fields on Product Page

DrByte:

Uploaded files will go into your /images/uploads folder, and will be named according to the order number.

I just tested this and the images are in the /images/uploads folder but they are just showing up as images and not according to order number.

For example:

  • My order number was 2
  • My images were named ryleigh_img.jpg (I uploaded 3 of the same to test)
  • When I go to the /images/uploads folder, this is what I see: 1.jpg, 2.jpg, 3.jpg

It's not naming the files correctly or putting them by order number. Is there a way to change this? It will be really important for me to have this information because each order I'm doing is customized according to the pictures.

Thanks

16 Aug 2011, 1:14 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Custom form fields on Product Page

If you look at the Order, you will see the number and the original image name next to it ...

The number, such as:

  • Logo Front: 1. 1_small.jpg (+$0.25)
  • Logo Back: 2. 2_small.jpg (+$0.25)

Indicates that there will be a filename by number with a matching file extension ...

So 1. 1_small.jpg means that there are files:
/upload/1.jpg
/upload/2.jpg

NOTE: The image numbers do not match the Order Number ...

16 Aug 2011, 2:47 PM
#12
jfenn avatar

jfenn

New Zenner

Join Date:
Jun 2008
Posts:
19
Plugin Contributions:
0

Re: Custom form fields on Product Page

Ajeh:

If you look at the Order, you will see the number and the original image name next to it ...

The number, such as:

  • Logo Front: 1. 1_small.jpg (+$0.25)
  • Logo Back: 2. 2_small.jpg (+$0.25)

Indicates that there will be a filename by number with a matching file extension ...

So 1. 1_small.jpg means that there are files:
/upload/1.jpg
/upload/2.jpg

NOTE: The image numbers do not match the Order Number ...

Ok, I think that makes sense. I did another order & it gave them the names of 4.jpg & 5.jpg, so I'll just go by those numbers.

One more question, though. Is there a way to make the add to cart button appear after the info is entered (at the bottom of the page)? This is my site http://www.bouquetofpixels.com/catalog/index.php?main_page=product_info&cPath=1_3&products_id=15

Thanks

16 Aug 2011, 3:05 PM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Custom form fields on Product Page

You can customize the template file using your templates and overrides:
tpl_product_info_display.php

and move the Add To Cart code below the Attributes ...

Add to Cart is delimited with:

<!--bof Add to Cart Box -->
// bunch of code here
<!--eof Add to Cart Box -->

Attributes is delimited with:

<!--bof Attributes Module -->
// bunch of code here
<!--eof Attributes Module -->
16 Aug 2011, 4:59 PM
#14
jfenn avatar

jfenn

New Zenner

Join Date:
Jun 2008
Posts:
19
Plugin Contributions:
0

Re: Custom form fields on Product Page

Ajeh:

You can customize the template file using your templates and overrides:
tpl_product_info_display.php

and move the Add To Cart code below the Attributes ...

Add to Cart is delimited with:

<!--bof Add to Cart Box -->

// bunch of code here

<!--eof Add to Cart Box -->
> 
> Attributes is delimited with:
> ```
<!--bof Attributes Module -->
// bunch of code here
<!--eof Attributes Module -->

Thanks so much. It worked like a charm! :clap:

I'm so glad I have all you smart people to rely on :D

16 Aug 2011, 5:08 PM
#15
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Custom form fields on Product Page

Thanks for the update that this is working ... :smile:

17 Aug 2011, 8:26 PM
#16
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

Re: Custom form fields on Product Page

hi this is probably not correct thread but at a loss so going to ask on the back of the foregoing. I have two custom fields added to my database and these are displaying on the product info display page, and i am able to complete these through EP so great. however i have installed tabbed products and it appears that the global setting for product description under tpp does not recognise the two extra custom fields so doesn't include them under the correct tab. would really like this feature to work so hopefully someone has some ideas on fix. thanks