Forums / General Questions / Add new field

Add new field

Locked

Started by j_xx on 28 Jan 2009, 9:45 AM · Views: 1,727

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
28 Jan 2009, 9:45 AM
#1
j_xx avatar

j_xx

New Zenner

Join Date:
Dec 2008
Location:
Uk
Posts:
79
Plugin Contributions:
0

Add new field

Hi, just a question, i've been trying to add a new field to the login form without success, i've followed the relevant thread and still no luck, has anyone else been able to add a field to the login form, if so, please could you explain in detail how this was achieved, or possibly allow your modified pages to be downloaded so others can use them, this is a really neat aspect to be able to oadd fields and it would also be a great step forward for website owners in general.

Is this possible ?

Cheers
J#xx

28 Jan 2009, 1:33 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add new field

While form fields can be added this does no good without a place in the DB to store it and the code that gets it there - then more code to extract it for later use

Zen-Venom Get Bitten

28 Jan 2009, 7:27 PM
#3
j_xx avatar

j_xx

New Zenner

Join Date:
Dec 2008
Location:
Uk
Posts:
79
Plugin Contributions:
0

Re: Add new field

So I take it that no one has successfully made an additional field into the registration form. A shame really because it would be a really good addition to the cart. I really need this to be a possibility as it would enable a lot of people including me, to extend the functionality of the login form to specifically cater for individual sites.

If it's too difficult then fair enough but if so many people can create such a good end result such as zencart, i'm sure a few additional fields to a form should be no challenge, but there we are !

Thanks.

J#xx

1 Feb 2009, 12:05 PM
#4
j_xx avatar

j_xx

New Zenner

Join Date:
Dec 2008
Location:
Uk
Posts:
79
Plugin Contributions:
0

Re: Add new field

Hi, after a fair while i've managed to get some new fields in my login form and they show up in the admin section as well, they store the data entered and display's it in admin and in edit my account. Sweet !, however if I attempt to edit these fields either in my account or in admin/customers the fields go blank. What's happening to make them blank out. is it something on the SQL side as I copied the code for the fax number and modified it to my field names. the fax number changes appear but not my fields ??

Cheers
J#xx
(Scott Perry)

1 Feb 2009, 4:24 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add new field

Hoping you have a test or develpoment install...

While poking around on another mission I stumbled upon a module that might be your answer....read carefully the instructions, install on a dev site to determine how it does or does not work,,,,happy coding

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=587

Zen-Venom Get Bitten

1 Feb 2009, 5:48 PM
#6
j_xx avatar

j_xx

New Zenner

Join Date:
Dec 2008
Location:
Uk
Posts:
79
Plugin Contributions:
0

Re: Add new field

Hi thanks for the advice and the add-on, i'll look into into it how about the blank feilds after an edit. Do you think it's a code based problem or a DB one ?

Nearly there !! - phew !

Cheers
J#xx
(Scott Perry)

3 Feb 2009, 8:14 AM
#7
drbyte avatar

drbyte

Sensei

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

Re: Add new field

J#xx:

however if I attempt to edit these fields either in my account or in admin/customers the fields go blank. What's happening to make them blank out. is it something on the SQL side as I copied the code for the fax number and modified it to my field names. the fax number changes appear but not my fields ??
You've probably incorrectly set defaults on the inputs, either for processing the submitted data, or when retrieving the data from the database.

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

3 Feb 2009, 9:47 AM
#8
j_xx avatar

j_xx

New Zenner

Join Date:
Dec 2008
Location:
Uk
Posts:
79
Plugin Contributions:
0

Re: Add new field

Hi,

"You've probably incorrectly set defaults on the inputs, either for processing the submitted data, or when retrieving the data from the database. "

Would this be in the php code or the DB ?

Cheers
J#xx
(Scott Perry)

It's so close I can almost taste it !

3 Feb 2009, 6:12 PM
#9
drbyte avatar

drbyte

Sensei

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

Re: Add new field

I was referring to your PHP code.

I can't be much more specific because you haven't indicated when the information gets wiped out.

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

3 Feb 2009, 9:16 PM
#10
j_xx avatar

j_xx

New Zenner

Join Date:
Dec 2008
Location:
Uk
Posts:
79
Plugin Contributions:
0

Re: Add new field

Hi, I thought I described it as it is, Log-in, enter data, data stored, go to admin/account, data appears, edit it's lost, go to edit my account information, edit a field, data lost ....
go to admin/customer edit a data field, data lost !

For some reason, every time the initial data is changed from the initial register account, the data get's lost ! does that help ?

Cheers
J#xx
FFS

If we can get this thing working exactly it could be an excellent mod for zencart in general.

4 Feb 2009, 7:54 AM
#11
drbyte avatar

drbyte

Sensei

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

Re: Add new field

J#xx:

Hi, I thought I described it as it is, Log-in, enter data, data stored, go to admin/account, data appears, edit it's lost, go to edit my account information, edit a field, data lost ....
go to admin/customer edit a data field, data lost !

For some reason, every time the initial data is changed from the initial register account, the data get's lost ! does that help ?
Sounds like wherever you're reading the POST field data you're either wiping it out or you're not actually storing the collected updates and it's storing blank data instead.
So either your parsing of POST inputs is wrong, or whatever variables you're passing to the code that stores the data to the database are wrong or blank. Maybe you need to check all the data to see what you're collecting and what you're writing, and figure out what's causing the difference.

J#xx:

If we can get this thing working exactly it could be an excellent mod for zencart in general.
Have fun supporting it!

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

4 Feb 2009, 2:30 PM
#12
j_xx avatar

j_xx

New Zenner

Join Date:
Dec 2008
Location:
Uk
Posts:
79
Plugin Contributions:
0

Re: Add new field

Hi, So far so good, I've got the admin side working and the login side working, they both exchange information correctly but its just the my account/edit my account details section that's causing the trouble.

The data apprears in the relevant fields as entered from either login or admin, but if I edit a field from the my account sectionand click update, it blanks the fields in every section including the DB.

I've checked the code a million times and looked at every page that references the "fax" field from the DevToolKit but it won't have it. any ideas as to a cure for the fields becoming blank ?

Cheers
J#xx
(Scott Perry)