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

Added field in registration

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 09-14-2003, 04:44 PM
 
Kanyon71 Kanyon71 is offline
 

Senior Member
  
Join Date: Oct 2002
Location: Lutz, FL
Posts: 128
 

Default Added field in registration

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.
__________________
Kanyon71
http://www.web-wizards.com
For hosting solutions that fully support X-Cart!
Mention the forums for a discounted package!
Reply With Quote
  #2  
Old 09-19-2003, 07:07 AM
  lildawg's Avatar 
lildawg lildawg is offline
 

X-Adept
  
Join Date: Jan 2003
Location: Utah
Posts: 686
 

Default

Reminder people. When listing a change please let users KNOW WHAT VERSION YOU CREATED IT FOR. It is sure getting hard to navigate these fixes and changes people are always listing because you never know what version it will work on. So please people start listing versions when posting fixes so people can figure it out. We have users using everything from 3.2 up and what works in one version doesnБ─≥t always work in another.
Reply With Quote
  #3  
Old 09-19-2003, 03:25 PM
 
Kanyon71 Kanyon71 is offline
 

Senior Member
  
Join Date: Oct 2002
Location: Lutz, FL
Posts: 128
 

Default

Sorry I actually meant to do that for the simple reason when I use them here I end up going hmmmmmmm how do I make this work in 3.4.4. BTW thats the version this was for. I think I have customers running most versions.
__________________
Kanyon71
http://www.web-wizards.com
For hosting solutions that fully support X-Cart!
Mention the forums for a discounted package!
Reply With Quote
  #4  
Old 11-12-2003, 09:55 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

Fabulous mod !

I've extended this a bit to make the referrer a selectable option

add the following in /config.php after the # Defined Titles area
Code:
# # Defined Referrers # $name_referrers = array("Search Engine","Magazine Ad","Newspaper Ad","Word of Mouth","Other"); $smarty->assign("name_referrers",$name_referrers);

In main/register.tpl use the following:
Code:
<tr valign=middle> <td align=right>{$lng.lbl_referer}</td> <td></td> <td nowrap> <select name=referred> {section name=referred loop=$name_referrers} <option {if $userinfo.referred eq $name_referrers[referred]}selected{/if}>{$name_referrers[referred]}</option> {/section} </select> </td> </tr>

Also for reference, if you're having trouble seeing the original mod correctly, make sure you add lbl_referrer to the languages table
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #5  
Old 11-12-2003, 11:40 PM
 
airntam airntam is offline
 

Advanced Member
  
Join Date: Jul 2003
Posts: 51
 

Default

Now is there a way to have this information in the order notification email that is sent to the admin? It looks like that pulls information out of a different table in the database. How can this information be accessed for the email notification? Any ideas?
Reply With Quote
  #6  
Old 11-13-2003, 10:07 AM
 
Kanyon71 Kanyon71 is offline
 

Senior Member
  
Join Date: Oct 2002
Location: Lutz, FL
Posts: 128
 

Default

I had started the code to make it selectable, got it to function then quickly firgured out that I couldn't use it. I get people from places that I have never heard of all the time. I am not posting to these sites nor is it search engines. It customers posting to forums that they found these things on my site.

As for the admin email you should be able to just pull it right from the Database. This is the tag I have in my sigin_admin_notification.tlp email

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

Hope this helps
__________________
Kanyon71
http://www.web-wizards.com
For hosting solutions that fully support X-Cart!
Mention the forums for a discounted package!
Reply With Quote
  #7  
Old 11-30-2003, 07:03 PM
 
ifalu ifalu is offline
 

Member
  
Join Date: Oct 2003
Posts: 28
 

Default How do you do the second step?

Next: I added a new label - lbl_referrer

You do this in config.php?

I am using V3.50
Reply With Quote
  #8  
Old 11-30-2003, 07:14 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

This is done in the languages section of the Xcart admin.

You will see a section towards the bottom of the page: "Add new entry"

Follow the format of the other language entries... and create the label above.

Make sure you select the correct "Topic" (Label) in the menu at the top.
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #9  
Old 11-30-2003, 08:50 PM
 
ifalu ifalu is offline
 

Member
  
Join Date: Oct 2003
Posts: 28
 

Default This is my code!

Thanks for your fast response. I created a label called refby. Got to create the label.

But when I do the mod's in register.php in the include folder and register.tpl in /customer/admin/

I don't have any field in the registration form. I am running V3.50

This is register.php

<?php
/************************************************** ***************************\
+-----------------------------------------------------------------------------+
| X-Cart |
| Copyright (c) 2001-2003 Ruslan R. Fazliev <rrf@rrf.ru> |
| All rights reserved. |
+-----------------------------------------------------------------------------+
| PLEASE READ THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" |
| FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE |
| AT THE FOLLOWING URL: http://www.x-cart.com/license.php |
| |
| THIS AGREEMENT EXPRESSES THE TERMS AND CONDITIONS ON WHICH YOU MAY USE |
| THIS SOFTWARE PROGRAM AND ASSOCIATED DOCUMENTATION THAT RUSLAN R. |
| FAZLIEV (hereinafter referred to as "THE AUTHOR") IS FURNISHING OR MAKING |
| AVAILABLE TO YOU WITH THIS AGREEMENT (COLLECTIVELY, THE "SOFTWARE"). |
| PLEASE REVIEW THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT |
| CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE. BY INSTALLING, |
| COPYING OR OTHERWISE USING THE SOFTWARE, YOU AND YOUR COMPANY |
| (COLLECTIVELY, "YOU") ARE ACCEPTING AND AGREEING TO THE TERMS OF THIS |
| LICENSE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THIS |
| AGREEMENT, DO NOT INSTALL OR USE THE SOFTWARE. VARIOUS COPYRIGHTS AND |
| OTHER INTELLECTUAL PROPERTY RIGHTS PROTECT THE SOFTWARE. THIS |
| AGREEMENT IS A LICENSE AGREEMENT THAT GIVES YOU LIMITED RIGHTS TO USE |
| THE SOFTWARE AND NOT AN AGREEMENT FOR SALE OR FOR TRANSFER OF TITLE.|
| THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT. |
| |
| The Initial Developer of the Original Code is Ruslan R. Fazliev |
| Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2003 |
| Ruslan R. Fazliev. All Rights Reserved. |
+-----------------------------------------------------------------------------+
\************************************************* ****************************/

#
# $Id: register.php,v 1.80 2003/11/17 06:25:49 svowl Exp $
#

if ( !defined('XCART_SESSION_START') ) { header("Location: ../"); die("Access denied"); }

x_session_register ("intershipper_recalc");
x_session_unregister("secure_oid");

require $xcart_dir."/include/countries.php";
require $xcart_dir."/include/states.php";

if (empty($mode)) $mode = "";

if ($REQUEST_METHOD == "POST") {

if ($current_area != "A" && $current_area!=$usertype && $mode!="checkout") {
echo "Hacking attempt!!!!"; exit;
}

#
# Do not check password mismatch
#
#$passwd2 = $passwd1;

#
# Anonymous registration (x-cart generates username by itself)
#
$anonymous_user=false;

if($anonymous && empty($uname) && $config["General"]["disable_anonymous_checkout"]!="Y") {
$max_anonimous = array_pop(func_query_first("select max(replace(login, '$anonymous_username_prefix', '')-0) from $sql_tbl[customers] where login like '$anonymous_username_prefix%'"));
$max_anonimous_orders = array_pop(func_query_first("select max(replace(login, '$anonymous_username_prefix', '')-0) from $sql_tbl[orders] where login like '$anonymous_username_prefix%'"));

$max_anonimous = max($max_anonimous, $max_anonimous_orders);

if($max_anonimous) {
$next_anonimous_number = $max_anonimous+1;
$uname = $anonymous_username_prefix.$next_anonimous_number;
}
else
$uname = $anonymous_username_prefix."1";

#
# All anonymous accounts must be customers
#
$usertype = "C";
$passwd1 = $anonymous_password;
$passwd2 = $anonymous_password;

$anonymous_user=true;
}
#
# User registration info passed to register.php via POST method
#
$existing_user = func_query_first("select password, email from $sql_tbl[customers] where login='$uname'");
if (empty($existing_user))
$existing_user = func_query_first("SELECT login FROM $sql_tbl[orders] WHERE login='$uname'");

if ($mode=="update") $uerror = false; else $uerror = !(empty($uname)) && !empty($existing_user);
#
# Check for errors
#
$uname_tmp=stripslashes($uname);
if ( strcmp($uname_tmp, $uname) !=0) {$error="Username ".$uname_tmp." is invalid! Please correct"; } else $error='';
$smarty->assign("error",$error);

$fillerror = (empty($uname) || !empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2) || empty($firstname) || empty($lastname) || empty($b_address) || empty($b_city) || (!empty($states) && empty($b_state)) || empty($b_country) || empty($b_zipcode) || empty($phone) || empty($email));

if (!(@$uerror || @$eerror || @$fillerror || @$error)) {
#
# Fields filled without errors. User registered successfully
#

$crypted = text_crypt($passwd1);
$s_address = trim($s_address);
$s_city = trim($s_city);
$s_zipcode = trim($s_zipcode);
if (empty($s_address) && empty($s_city) && empty($s_zipcode)) {
$s_state = $b_state;
$s_country = $b_country;
}
if (empty($s_address)) $s_address = $b_address;
if (empty($s_city)) $s_city = $b_city;
if (empty($s_zipcode)) $s_zipcode = $b_zipcode;
#
# Add new member to newsletter list
#
if( !empty($existing_user) && $existing_user["email"] != $email )
db_query("delete from $sql_tbl[maillist] where email='$existing_user[email]'");

if(!empty($newsletter)) {
$mailcnt = array_pop( func_query_first("select count(*) from $sql_tbl[maillist] where email='$email'") );
if( empty($mailcnt) )
db_query("insert into $sql_tbl[maillist] (email, since_date) values ('$email','".time()."')");
}
else
db_query("delete from $sql_tbl[maillist] where email='$email'");

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

#
# Update membership
#
if($current_area=="A" || ($active_modules["Simple_Mode"] && $current_area=="P")) db_query("update $sql_tbl[customers] set membership='$membership' where login='$login' and usertype='$login_type'");

$registered="Y";

#
# Send mail notifications to customer department and signed customer
#
$newuser_info = func_userinfo($login,$login_type);
$mail_smarty->assign("userinfo",$newuser_info);

#
# Send mail to registered user
#
$customer_language = func_get_language ($newuser_info["language"]);

func_send_mail($newuser_info["email"], "mail/profile_modified_subj.tpl", "mail/profile_modified.tpl", $config["Company"]["users_department"], false);
#
# Send mail to customers department
#
func_send_mail($config["Company"]["users_department"], "mail/profile_admin_modified_subj.tpl", "mail/profile_admin_modified.tpl", $newuser_info["email"], true);


} else {
#
# 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,comp any,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,pendi ng_membership,ssn,refby) values ('$uname','$usertype','".@$membership."','$crypted ','".@$password_hint."','".@$password_hint_answer. "','$title','$firstname','$lastname','$company','$ b_address','$b_city','$b_state','$b_country','$b_z ipcode','$s_address','$s_city','$s_state','$s_coun try','$s_zipcode','$phone','$email','$fax','$url', '".@$card_name."','".@$card_type."','".text_crypt( @$card_number)."','".@$card_expire."','".@$card_cv v2."','".time()."','Y','".@$RefererCookie."','".@$ pending_membership."','".@$ssn."','$refby')");

#
# Update store language for new customer from current $store_language
#
if ($store_language)
db_query ("UPDATE $sql_tbl[customers] SET language='$store_language' WHERE login='$uname'");

#
# If it is partner, add his information
#
if ($usertype == "B") {
db_query ("INSERT INTO $sql_tbl[partner_commissions] (login, plan_id) VALUES ('$uname','0')");
}

#
# Set A-status
#
if($anonymous_user) db_query("update $sql_tbl[customers] set status='A' where login='$uname' and usertype='$usertype'");

$registered="Y";

#
# Send mail notifications to customer department and signed customer
#
$newuser_info = func_userinfo($uname,$usertype);
$mail_smarty->assign("userinfo",$newuser_info);

#
# Send mail to registered user (do not send to anonymous)
#
if(!$anonymous_user)
if ($usertype=="B")
func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_partner_notif.tpl", $config["Company"]["users_department"], false);
else
func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_notification.tpl", $config["Company"]["users_department"], false);
#
# Send mail to customers department
#
if(!$anonymous_user)
func_send_mail($config["Company"]["users_department"], "mail/signin_admin_notif_subj.tpl", "mail/signin_admin_notification.tpl", $email, true);

#
# Auto-log in
#
#if($anonymous_user && $usertype=="C") [
if($usertype=="C" or ($usertype=="B" and $login=="")) {
$auto_login = true;
$login = $uname;
$login_type = $usertype;
$logged = "";
}

}
} else {
#
# Fields filled with errors
#
if (!empty($fillerror)) $reg_error="F";
if (!empty($eerror)) $reg_error="E";
if (!empty($uerror)) $reg_error="U";
}
if($anonymous_user) {
$uname="";
$passwd1="";
$passwd2="";
}
#
# Fill $userinfo array if error occured
#
$userinfo=$HTTP_POST_VARS;
$userinfo["login"] = $uname;
$userinfo["newsletter"] = (!empty($newsletter)?"Y":"");

}
else {
#
# REQUEST_METHOD = GET
#
if ($mode=="update") {
if ($action == "cart") {
$userinfo = func_userinfo($login,$login_type,true);
if (!empty($extended_userinfo))
$userinfo = array_merge($userinfo, $extended_userinfo);
}
else
$userinfo = func_userinfo($login,$login_type);
}
elseif ($mode=="delete" && @$confirmed=="Y") {

$olduser_info = func_userinfo($login,$login_type);

$customer_language = func_get_language ($olduser_info);

func_delete_profile($login,$login_type);
$login="";
$login_type="";
$smarty->clear_assign("login");
#
# Send mail notifications to customer department and signed customer
#
$mail_smarty->assign("userinfo",$olduser_info);

#
# Send mail to registered user
#
if (strstr($olduser_info["login"], $anonymous_username_prefix) ) $anonymous_user=true;
else $anonymous_user=false;
if(!$anonymous_user)
func_send_mail($olduser_info["email"], "mail/profile_deleted_subj.tpl", "mail/profile_deleted.tpl", $config["Company"]["users_department"], false);
#
# Send mail to customers department
#
if(!$anonymous_user)
func_send_mail($config["Company"]["users_department"], "mail/profile_admin_deleted_subj.tpl", "mail/profile_admin_deleted.tpl", $olduser_info["email"], true);

}
}

if (!empty($uerror) || !empty($eerror) || !empty($fillerror) || !empty($error)) {
$userinfo["firstname"]=stripslashes($firstname);
$userinfo["lastname"]=stripslashes($lastname);
$userinfo["company"]=stripslashes($company);
$userinfo["ssn"]=stripslashes(@$ssn);
$userinfo["b_address"]=stripslashes($b_address);
$userinfo["b_city"]=stripslashes($b_city);
$userinfo["b_state"]=stripslashes($b_state);
$userinfo["b_zipcode"]=stripslashes($b_zipcode);
$userinfo["s_address"]=stripslashes($s_address);
$userinfo["s_city"]=stripslashes($s_city);
$userinfo["s_state"]=stripslashes($s_state);
$userinfo["s_zipcode"]=stripslashes($s_zipcode);
$userinfo["phone"]=stripslashes($phone);
$userinfo["fax"]=stripslashes($fax);
$userinfo["uname"]=stripslashes($uname);
$userinfo["login"]=stripslashes($uname);
$userinfo["passwd1"]=stripslashes($passwd1);
$userinfo["passwd2"]=stripslashes($passwd2);
$userinfo["password_hint"]=stripslashes(@$password_hint);
$userinfo["password_hint_answer"]=stripslashes(@$password_hint_answer);
$userinfo[refby]=stripslashes($refby);
}

if (!empty($userinfo)) {
foreach ($userinfo as $key=>$value){
if (is_string($value))
$userinfo[$key]=htmlspecialchars($value);
}
$smarty->assign("userinfo",$userinfo);
}
if (!empty($registered))
$smarty->assign("registered",$registered);
if (!empty($reg_error))
$smarty->assign("reg_error",$reg_error);

if($mode=="delete") {
$smarty->assign("main","profile_delete");
}
elseif($mode=="notdelete") {
$smarty->assign("main","profile_notdelete");
}
else
$smarty->assign("main","register");

x_session_save();
?>


This is register.tpl

{* $Id: register.tpl,v 1.7 2003/11/17 06:25:56 svowl Exp $ *}
{include file="check_email_script.tpl"}
{include file="check_zipcode_js.tpl"}
{if $smarty.get.mode eq "update" or $smarty.post.mode eq "update"}
{assign var="last_location" value=$lng.lbl_modify_profile}
{elseif $smarty.get.mode eq "delete" or $smarty.post.mode eq "delete"}
{assign var="last_location" value=$lng.lbl_delete_profile}
{elseif $last_location eq ""}
{assign var="last_location" value=$lng.lbl_new_member}
{/if}
{include file="location.tpl" last_location=$last_location}
{if $usertype ne "C"}
This section allows you to {if $smarty.get.mode eq "add"}create{else}modify{/if} customer's profile. Please remember that the fields marked with '<font class=Star>*</font>' are mandatory and must be filled.



{/if}
{if $newbie eq "Y"}
{if $registered eq ""}
{if $smarty.get.mode eq "update"}
{$lng.txt_modify_profile_msg}
{else}
<font class=Text>
{if $usertype eq "B"}
{$lng.txt_create_profile_msg_partner}
{else}
{$lng.txt_create_profile_msg}
{/if}
</font>
{/if}
{/if}



{/if}
{capture name=dialog}
{if $registered eq ""}
{if $reg_error eq "F" }
<font class=Star>
{$lng.txt_registration_error}

</font>
{elseif $reg_error eq "E" }
<font class=Star>{$lng.txt_email_already_exists}
</font>
{elseif $reg_error eq "U" }
<font class=Star>{$lng.txt_user_already_exists}</font>

{/if}
{if $error ne ""}
<font class=Star>{$error}</font>

{/if}
<table width=100% border=0 cellspacing=0 cellpadding=2>
<form action="{ $register_script_name }?{ $smarty.server.QUERY_STRING }" method=post name=registerform>

{include file="main/register_personal_info.tpl" userinfo=$userinfo}

{include file="main/register_billing_address.tpl" userinfo=$userinfo}

{include file="main/register_shipping_address.tpl" userinfo=$userinfo}

{include file="main/register_contact_info.tpl" userinfo=$userinfo}

{if $usertype eq "C" or $smarty.get.usertype eq "C"}
{if $config.General.disable_cc ne "Y"}
{include file="main/register_ccinfo.tpl"}
{/if}
{/if}

<tr valign=middle>
<td height=20 colspan=3>{$lng.lbl_username_n_password}<hr size=1 noshade></td>
</tr>
{if $userinfo.login eq $login and $login and $userinfo.usertype ne "C"}
<input type=hidden name=membership value="{$userinfo.membership}"></d>
<input type=hidden name=pending_membership value="{$userinfo.pending_membership}"></d>
{else}
{if $config.General.membership_signup eq "Y" and ($usertype eq "C" or ($active_modules.Simple_Mode ne "" and $usertype eq "P") or $usertype eq "A")}
{include file="admin/main/membership_signup.tpl"}
{/if}
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode ne "")}
{include file="admin/main/membership.tpl"}
{/if}
{/if}

{if $anonymous ne "" and $config.General.disable_anonymous_checkout ne "Y"}
{* Anonymous account *}
<tr>
<td colspan=3>{$lng.txt_anonymous_account_msg}</TD>
</tr>
<tr valign=middle>
<td align=right>{$lng.lbl_username}</td>
<td></td>
<td nowrap>
<input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}">
</td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_password}</td>
<td></td>
<td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}">
</td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_confirm_password}</td>
<td></td>
<td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}">
</td>
</tr>
{else}
{* NOT anonymous account *}
<tr valign=middle>
<td align=right>{$lng.lbl_username}</td>
<td><font class=Star>*</font></td>
<td nowrap>
{if $smarty.get.mode eq "update" or $smarty.post.mode eq "update"}
{$userinfo.login}
<input type=hidden name=uname value="{$userinfo.login}">
{else}
<input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}">
{if $reg_error ne "" and $userinfo.login eq ""}<font class=Star>&lt;&lt;</font>{/if}
{/if}
</td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_password}</td>
<td><font class=Star>*</font></td>
<td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}">
{if $reg_error ne "" and $userinfo.passwd1 eq ""}<font class=Star>&lt;&lt;</font>{/if}
</td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_confirm_password}</td>
<td><font class=Star>*</font></td>
<td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}">
{if $reg_error ne "" and $userinfo.passwd2 eq ""}<font class=Star>&lt;&lt;</font>{/if}
</td>
</tr>
{/if}

{*
<tr valign=middle>
<td align=right>{$lng.lbl_password_hint}</td>
<td></td>
<td nowrap><input type=text name=password_hint size=32 maxlength=32 value="{$userinfo.password_hint}"></td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_password_hint_answer}</td>
<td></td>
<td nowrap><input type=text name=password_hint_answer size=32 maxlength=32 value="{$userinfo.password_hint_answer}"><tr valign=middle>
<td align=right>{$lng.lbl_refby}</td>
<td></td>
<td nowrap>
<input type=text name=refby value="{$userinfo.refby}">
</td>
</tr>
</td>
</tr>
*}

<tr valign=middle>
<td height=20 colspan=3>{$lng.lbl_newsletter}<hr size=1 noshade></td>
</tr>

<tr valign=middle>
<td></td>
<td></td>
<td>
<input type=checkbox name=newsletter {if $userinfo.newsletter eq "Y"}checked{/if}>
{$lng.txt_newsletter_msg}
</td>
</tr>

<tr valign=middle>
<td></td>
<td></td>
<td>
{if $newbie eq "Y"}



{$lng.txt_you_are_agree} <font class=Text>{$lng.lbl_terms_n_conditions}</font>.
{/if}



<font class=FormButton>
{if $smarty.get.mode eq "update"}
<input type=hidden name=mode value=update>
{/if}
<input type=hidden name=anonymous value={$anonymous}>
{if $js_enabled}
{include file="buttons/submit.tpl" style="button"}
{else}
{include file="submit_wo_js.tpl" value=$lng.lbl_submit}
{/if}
</td>
</tr>
<input type=hidden name=usertype value="{if $smarty.get.usertype ne ""}{$smarty.get.usertype|escape:"html"}{else}{$use rtype}{/if}">
</form>
</table>
{if $newbie eq "Y"}
{$lng.txt_newbie_registration_bottom}

<nobr><font class=Text>{$lng.lbl_terms_n_conditions}</font>{include file="buttons/go.tpl"}</nobr>
{/if}
{else}
{if $smarty.post.mode eq "update" or $smarty.get.mode eq "update"}
{$lng.txt_profile_modified}
{elseif $smarty.get.usertype eq "B" or $usertype eq "B"}
{$lng.txt_partner_created}
{else}
{$lng.txt_profile_created}
{/if}
{/if}
{/capture}
{if $smarty.post.mode eq "update" or $smarty.get.mode eq "update"}
{include file="dialog.tpl" title=$lng.lbl_modify_profile content=$smarty.capture.dialog extra="width=100%"}
{else}
{include file="dialog.tpl" title=$lng.lbl_new_member content=$smarty.capture.dialog extra="width=100%"}
{/if}
Reply With Quote
  #10  
Old 12-01-2003, 05:21 AM
 
Kanyon71 Kanyon71 is offline
 

Senior Member
  
Join Date: Oct 2002
Location: Lutz, FL
Posts: 128
 

Default

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.
__________________
Kanyon71
http://www.web-wizards.com
For hosting solutions that fully support X-Cart!
Mention the forums for a discounted package!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 10:58 PM.

   

 
X-Cart forums © 2001-2020