Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Pre-filling data in text field attribute

Pre-filling data in text field attribute

Views: 2,782

Results 1 to 9 of 9
1 Sep 2009, 3:06 AM
#1
qwerpoiu338 avatar

qwerpoiu338

New Zenner

Join Date:
Dec 2007
Location:
Ontario, Canada
Posts:
27
Plugin Contributions:
0

Pre-filling data in text field attribute

How can I display field data from the "CUSTOMERS" table on to the confirmation page (page after "Add to Cart" button is clicked)?

Zen Cart 1.3.8 (fresh install)

13 Sep 2009, 5:57 AM
#2
qwerpoiu338 avatar

qwerpoiu338

New Zenner

Join Date:
Dec 2007
Location:
Ontario, Canada
Posts:
27
Plugin Contributions:
0

Re: Pre-filling data in text field attribute

Genevieve:

I am building a site for products that will be personalized with customer-specified information, so I need to add a handful of custom fields to my product details page that will allow customers to enter the info they want used in the personalization of their item. Ideally, they would add this data ON the product listing page, the custom data would be held temporarily when they click "Add to cart" and then stored and displayed in their order invoice once they check out and the transaction is complete. How would I go about doing this?

Hi, I have the similar situation. But would like to extract data from the CUSTOMERS table and transfer it on to some of the attribute text fields automatically within the product details page. Can someone please let me know how this can be done?

15 Sep 2009, 1:22 AM
#3
qwerpoiu338 avatar

qwerpoiu338

New Zenner

Join Date:
Dec 2007
Location:
Ontario, Canada
Posts:
27
Plugin Contributions:
0

Re: Pre-filling data in text field attribute

qwerpoiu338:

Hi, I have the similar situation. But would like to extract data from the CUSTOMERS table and transfer it on to some of the attribute text fields automatically within the product details page. Can someone please let me know how this can be done?

Anyone got any suggestions? Thanks in advance.

17 Sep 2009, 3:14 AM
#4
qwerpoiu338 avatar

qwerpoiu338

New Zenner

Join Date:
Dec 2007
Location:
Ontario, Canada
Posts:
27
Plugin Contributions:
0

Re: Pre-filling data in text field attribute

Created a text input field as one of the product attributes used for personalizing an item. How can I pre-fill these fields with data from $_SESSION['customer_first_name'], $_SESSION['customer_last_name'], etc.? Looked into tpl_product_info_display, tpl_modules_attributes.php and attributes.php but not sure how to do it as I'm limited with PHP codings. Any help is appreciated.

24 Sep 2009, 5:33 AM
#5
qwerpoiu338 avatar

qwerpoiu338

New Zenner

Join Date:
Dec 2007
Location:
Ontario, Canada
Posts:
27
Plugin Contributions:
0

Re: Pre-filling data in text field attribute

I created a few text input fields as product attributes used for personalizing an item. Is there a way to pre-fill these fields with data from fields in CUSTOMERS table(eg. first and last name)? Looked into tpl_product_info_display, tpl_modules_attributes.php and attributes.php but not sure how to do it as I'm limited with PHP codings. I've seen something similar (pre-filling first/last name, tel num) was done on the CONTACT US page. However I really cant' figure out which files to modify for the attributes. Any help is appreciated.

24 Sep 2009, 8:43 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Pre-filling data in text field attribute

/includes/modules/your_template/attributes.php would be the place to insert the text prefilling functionality. The text option code is built starting at line 388, and added to the output accumulator arrays at line 509.

14 Oct 2009, 5:38 AM
#7
qwerpoiu338 avatar

qwerpoiu338

New Zenner

Join Date:
Dec 2007
Location:
Ontario, Canada
Posts:
27
Plugin Contributions:
0

Re: Pre-filling data in text field attribute

got it to work finally. Thanks!!

14 Oct 2009, 3:09 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Pre-filling data in text field attribute

That's good to know! Would you mind sharing how you did it? It would be a big help to others wanting the same thing.

24 Feb 2010, 2:19 AM
#9
sdelaney avatar

sdelaney

New Zenner

Join Date:
Feb 2010
Posts:
45
Plugin Contributions:
0

Re: Pre-filling data in text field attribute

Just wondering if the solution was ever posted anywhere? I have exactly the same requirement, to copy customer data and pre-populate some product attributes.