Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Add Line in Register

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-11-2003, 08:24 AM
 
Parrot Parrot is offline
 

eXpert
  
Join Date: Sep 2002
Location: MD USA
Posts: 350
 

Default Add Line in Register

Okay, I am using 3.3.2
I want to add lines to my register form

I would prefer to use a lbl for the New Field, but the original code was not done that way...

I went to my MySQL db. changed the SSN code line to a new name (as per previously done) Note: I did not simply add the title line in the db itself, but rather did this in the section where the titles are set up (not where the data is held)...hope this makes sense.

Okay, I tested this...it appears to work when registering a new test customer. It does not indicate an error. But when I view the db for the customers list, this new test customer does not show.

If this is the problem, how do I go about solving this problem?
This is the only part of the code that I do not follow as to what and where it is coming from or how to set it up.

(edited)

Thanks so much for your assistance!!!

Parrot
__________________
Version: 4.4.2
Host: EWDhosting
Mods: BCSE
Reply With Quote
  #2  
Old 03-11-2003, 09:30 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

I am assuming that you haven't changed the name of the field in the database but on on the customer facing stuff/language file.

Change the <input type=text name=pet_name size=32 maxlength=32 value="{$userinfo.pet_name}">
to
<input type=text name=ssn size=32 maxlength=32 value="{$userinfo.ssn}">

and all should work with all the existing code taking the value from ssn and putting it into the right place in the database and then displaying it again.
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 03-11-2003, 10:21 AM
 
Parrot Parrot is offline
 

eXpert
  
Join Date: Sep 2002
Location: MD USA
Posts: 350
 

Default

okay, so basically if I change the name SSN to New Field I need to still use SSN in the code right?

Now if I want to add yet still another line (which there were two lines added in the other version), would it work correctly the way I wrote the code for the 2nd one?.... but just not working now because I changed the SSN section?

To keep things simple, I am thinking that perhaps instead of replacing ssn, I would create the two extra lines and leave the ssn inside of the {* *} for possible later use.

So, if I have this correct, the code is fine as is if I don't replace ssn, but rather simply add the new line in the db (list of lines for the customer), and add the lbl, also add the template lines as indicated above?

Please let me know if I have that right.

Thanks,
Parrot
__________________
Version: 4.4.2
Host: EWDhosting
Mods: BCSE
Reply With Quote
  #4  
Old 03-11-2003, 10:29 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Didn't follow your last bit, but yes, if you simply re-use an existing field but just change the label, all the rest will work fine.
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 03-11-2003, 12:08 PM
 
Parrot Parrot is offline
 

eXpert
  
Join Date: Sep 2002
Location: MD USA
Posts: 350
 

Default

Okay, fine. Thanks. I guess I was not exactly clear on everything that I need to know.

I will need to add an additional 2 lines. I have tried to copy the exact code used to add the 2nd item. That did not work. The only thing I can think of, is that I am forgetting to add something somewhere to get the data to transfer to the db.


HELP!
__________________
Version: 4.4.2
Host: EWDhosting
Mods: BCSE
Reply With Quote
  #6  
Old 03-12-2003, 05:52 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

The missing link is the file that receives the information and inputs into the database.

Think that line 121 of register.php is where you will need to amend:

Code:
db_query("update $sql_tbl[customers] set password='$crypted', password_hint='$password_hint', password_hint_answer='$password_hint_answer', title='$title', firstname='$firstname', lastname='$lastname', company='$company', b_address='$b_address', b_city='$b_city', b_state='$b_state', b_country='$b_country', b_zipcode='$b_zipcode', s_address='$s_address', s_city='$s_city', s_state='$s_state', s_country='$s_country', s_zipcode='$s_zipcode', phone='$phone', email='$email', fax='$fax', url='$url', card_name='$card_name', card_type='$card_type', card_number='".text_crypt($card_number)."', card_expire='$card_expire', card_cvv2='$card_cvv2', pending_membership='$pending_membership', ssn='$ssn' where login='$login' and usertype='$login_type'");

make sure that your new fields are added into this sql query.

ie:
, newfield1='$newfield1', newfield2='$newfield2'

where the $newfield1 is the name of the form input field and newfield1 is the name of the db field.

hth
__________________
ex x-cart guru
Reply With Quote
  #7  
Old 03-12-2003, 11:44 AM
 
Parrot Parrot is offline
 

eXpert
  
Join Date: Sep 2002
Location: MD USA
Posts: 350
 

Default

Thanks for directing me in the right direction!

I found there was quite a few code adjustments that were needed just to add a line, but I was able to find all the related code (I hope) once I knew that I had to go outside of the db and program to edit something like this.

Looking at these codes, certainly gives me an even greater deep respect for programmers!
__________________
Version: 4.4.2
Host: EWDhosting
Mods: BCSE
Reply With Quote
  #8  
Old 03-12-2003, 02:30 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

__________________
ex x-cart guru
Reply With Quote
  #9  
Old 03-12-2003, 05:31 PM
 
Parrot Parrot is offline
 

eXpert
  
Join Date: Sep 2002
Location: MD USA
Posts: 350
 

Default

Got it done! Works Great! I tested it a few times. Not sure what all the coding is doing, but it is working!


Can you tell me what "stripslashes" in Smarty does?
Is that to delete any slashes entered on the user end to keep such slashes from interfering with the programming?

Thanks!
__________________
Version: 4.4.2
Host: EWDhosting
Mods: BCSE
Reply With Quote
  #10  
Old 03-12-2003, 10:27 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

What it does is the reverse of addslashes.

Add slashes takes entries that have been put into the input fields and 'escapes' certain characters that would have a detrimental effect if you tried to put them straight into the database, such as ' " and adds a \ in front to escape them.

Strip slashes removes these \'s

hth
__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:41 AM.

   

 
X-Cart forums © 2001-2020