X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Added field in registration (https://forum.x-cart.com/showthread.php?t=4352)

Kanyon71 12-01-2003 05:21 AM

I am not quite sure what your asking here. Are you talking about you do not have this field in the .tpl file? If thats the case it won't exist in there you're adding it. If you mean the .php file looking at the file you pasted in it's not super different, just have to find the correct place to add the variables to it. I am just now starting on a 3.5.0 store for a customer who's using an older version and this is one of the things I will be adding for him. So once I get to the point if you're not up and running I will post any changes I had to make here.

escott 12-28-2003 08:20 PM

Ok, I followed everything in here, mods on the php's mods to the tpl's and still I don't see it in the registration form. I am using the latest version 3.5.1 and I can not get it to work. When I look at a customers information I see it there but it looks like it's the last page he clicked on before he checked out. I am trying to get the drop down to work in the customer area. If anyone has figured this out with this version please let me know.

escott 12-28-2003 08:37 PM

Ok, I figured it out in 3.5.1 you must make the changes to File: /main/register_personal_info.tpl not the mailn/register.tpl also if you did the first mod then switched to the drop down mod, make sure you change your label name.

Learner 05-21-2010 03:33 AM

Re: Added field in registration
 
Quote:

Originally Posted by Kanyon71
Well I added a How did you hear about us to the registration process. Used some code I had found in other posts, I also added fields to my email's for siginin and modify for users. This is pretty much what I did:

First: Added the new field to the database using myphpadmin

Code:

ALTER TABLE `xcart_customers` ADD `referred` VARCHAR(255) NOT NULL;

Next: I added a new label - lbl_referrer

Next: I modified my include/register.php

Code:

Original code:
#
# Update/Insert user info
#

if ($mode=="update") {
    $intershipper_recalc = "Y";

    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'");


New Code:
#
# Update/Insert user info
#

if ($mode=="update") {
    $intershipper_recalc = "Y";

    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', referred='$referred', ssn='$ssn' where login='$login' and usertype='$login_type'");


Next Change:

Old Code:
#
# Add new person to customers table
#
    $intershipper_recalc = "Y";

    db_query("insert into $sql_tbl[customers] (login,usertype,membership,password,password_hint,password_hint_answer,title,firstname,lastname,company,b_address,b_city,b_state,b_country,b_zipcode,s_address,s_city,s_state,s_country,s_zipcode,phone,email,fax,url,card_name,card_type,card_number,card_expire,card_cvv2,first_login,status,referer,pending_membership,ssn) values ('$uname','$usertype','$membership','$crypted','$password_hint','$password_hint_answer','$title','$firstname','$lastname','$company','$b_address','$b_city','$b_state','$b_country','$b_zipcode','$s_address','$s_city','$s_state','$s_country','$s_zipcode','$phone','$email','$fax','$url','$card_name','$card_type','".text_crypt($card_number)."','$card_expire','$card_cvv2','".time()."','Y','$RefererCookie','$pending_membership','$ssn')");



New Code:
#
# Add new person to customers table
#
    $intershipper_recalc = "Y";

    db_query("insert into $sql_tbl[customers] (login,usertype,membership,password,password_hint,password_hint_answer,title,firstname,lastname,company,b_address,b_city,b_state,b_country,b_zipcode,s_address,s_city,s_state,s_country,s_zipcode,phone,email,fax,url,referred,card_name,card_type,card_number,card_expire,card_cvv2,first_login,status,referer,pending_membership,ssn) values ('$uname','$usertype','$membership','$crypted','$password_hint','$password_hint_answer','$title','$firstname','$lastname','$company','$b_address','$b_city','$b_state','$b_country','$b_zipcode','$s_address','$s_city','$s_state','$s_country','$s_zipcode','$phone','$email','$fax','$url','$referred','$card_name','$card_type','".text_crypt($card_number)."','$card_expire','$card_cvv2','".time()."','Y','$RefererCookie','$pending_membership','$ssn')");

Final Change in this file is adding a field towards the bottom of the file:

$userinfo[referred]=stripslashes($referred);

I added this after company.


Next: I modified skin/main/register.tpl
Following was added after company once again.

Code:


<tr valign=middle>
<td align=right>{$lng.lbl_referer}</td>
<td></td>
<td nowrap>
<input type=text name=referred value="{$userinfo.referred}">
</td>
</tr>


Next: I modified skin1/mail/signin_notification.tpl and skin1/mail/profile_admin_modified.tpl

The following code was added to the bottom of the file.

Code:


 
{$lng.lbl_referer}:      {$userinfo.referred}



The
is in the there as I have all of my emails in HTML (well some of them far more html then others)

Thanks to all those whose code I found, hope someone gets some use out of this. Took me a while of playing around to get the sql to work right and the fields to store correctly and display correctly.


I know that it is old post but I want to add Date of birth (D-M-Y ) and Date of anniversary (D-M-Y) in registration page.How to add it ? It will be better if we add a calender options.

How to do it?

Can you help me?

Thanks to all.

Learner 12-20-2010 01:33 AM

Re: Added field in registration
 
How to achieve this??


All times are GMT -8. The time now is 05:57 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.