Thread: 2 Address Lines
View Single Post
  #4  
Old 08-29-2003, 04:19 AM
 
rodneyw rodneyw is offline
 

Senior Member
  
Join Date: Mar 2003
Posts: 162
 

Default

whew .. what a mess. I hope I have all this right. Use at your own risk and if you try it make sure you BACK EVERYTHING UP!!

My ONLY concern is that I missed a tpl file somewhere that needs to display the new address lines. Here is what I have done if anyone wants to give it a try. If you see ANYTHING wrong please let me know.

```````````````````````````````````````

Using phpMyAdmin you will need to modify your CUSTOMER table in the database.
Insert new field AFTER b_address with the name b_address2
Insert new field AFTER s_address with the name s_address2

Using phpMyAdmin you will need to modify your ORDERS table in the database.
Insert new field AFTER b_address with the name b_address2
Insert new field AFTER s_address with the name s_address2



PHP FILE: include/register.php

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

WITH
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_address2='$b_address2', b_city='$b_city', b_state='$b_state', b_country='$b_country', b_zipcode='$b_zipcode', s_address='$s_address', s_address2='$s_address2', 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'");



REPLACE
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_addres s,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')");


WITH
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_address2,b_city,b_state,b_country,b_zipco de,s_address,s_address2,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,refer er,pending_membership,ssn) values ('$uname','$usertype','$membership','$crypted','$password_hint','$password_hint_answer','$title','$firstname','$lastname','$company','$b_address','$b_address 2','$b_city','$b_state','$b_country','$b_zipcode','$s_address','$s_address2','$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')");



REPLACE
Code:
if ($uerror || $eerror || $fillerror || $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);


WITH
Code:
if ($uerror || $eerror || $fillerror || $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_address2]=stripslashes($b_address2); $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_address2]=stripslashes($s_address2); $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);



PHP FILE: include/func.php

REPLACE
Code:
Insert into orders # db_query("insert into $sql_tbl[orders] (login, total, giftcert_discount, giftcert_ids, subtotal, shipping_cost, shippingid, tax, tax_gst, tax_pst, total_vat, taxes_applyed, discount, coupon, coupon_discount, date, status, payment_method, flag, details, 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, fax, email, url, reg_numbers) values ('".addslashes($userinfo["login"])."', '$current_order[total_cost]', '$giftcert_discount', '$giftcert_str', '$current_order[sub_total]','$current_order[shipping_cost]', '$cart[shippingid]', '$current_order[tax_cost]', '$current_order[tax_gst]', '$current_order[tax_pst]', '$current_order[total_vat]', '$taxes_applyed', '$current_order[discount]', '".addslashes($current_order[coupon])."', '$current_order[coupon_discount]', '".time()."', '$order_status', '".addslashes($payment_method)."', 'N', '".addslashes(text_crypt($order_details))."', '".addslashes($userinfo["title"])."', '".addslashes($userinfo["firstname"])."', '".addslashes($userinfo["lastname"])."', '".addslashes($userinfo["company"])."', '".addslashes($userinfo["b_address"])."', '".addslashes($userinfo["b_city"])."', '".addslashes($userinfo["b_state"])."', '".addslashes($userinfo["b_country"])."', '".addslashes($userinfo["b_zipcode"])."', '".addslashes($userinfo["s_address"])."', '".addslashes($userinfo["s_city"])."', '".addslashes($userinfo["s_state"])."', '".addslashes($userinfo["s_country"])."', '".addslashes($userinfo["s_zipcode"])."', '".addslashes($userinfo["phone"])."', '".addslashes($userinfo["fax"])."', '$userinfo[email]', '".addslashes($userinfo["url"])."', '$reg_numbers')");

WITH
Code:
Insert into orders # db_query("insert into $sql_tbl[orders] (login, total, giftcert_discount, giftcert_ids, subtotal, shipping_cost, shippingid, tax, tax_gst, tax_pst, total_vat, taxes_applyed, discount, coupon, coupon_discount, date, status, payment_method, flag, details, title, firstname, lastname, company, b_address, b_address2, b_city, b_state, b_country, b_zipcode, s_address, s_address2, s_city, s_state, s_country, s_zipcode, phone, fax, email, url, reg_numbers) values ('".addslashes($userinfo["login"])."', '$current_order[total_cost]', '$giftcert_discount', '$giftcert_str', '$current_order[sub_total]','$current_order[shipping_cost]', '$cart[shippingid]', '$current_order[tax_cost]', '$current_order[tax_gst]', '$current_order[tax_pst]', '$current_order[total_vat]', '$taxes_applyed', '$current_order[discount]', '".addslashes($current_order[coupon])."', '$current_order[coupon_discount]', '".time()."', '$order_status', '".addslashes($payment_method)."', 'N', '".addslashes(text_crypt($order_details))."', '".addslashes($userinfo["title"])."', '".addslashes($userinfo["firstname"])."', '".addslashes($userinfo["lastname"])."', '".addslashes($userinfo["company"])."', '".addslashes($userinfo["b_address"])."', '".addslashes($userinfo["b_address2"])."', '".addslashes($userinfo["b_city"])."', '".addslashes($userinfo["b_state"])."', '".addslashes($userinfo["b_country"])."', '".addslashes($userinfo["b_zipcode"])."', '".addslashes($userinfo["s_address"])."', '".addslashes($userinfo["s_address2"])."', '".addslashes($userinfo["s_city"])."', '".addslashes($userinfo["s_state"])."', '".addslashes($userinfo["s_country"])."', '".addslashes($userinfo["s_zipcode"])."', '".addslashes($userinfo["phone"])."', '".addslashes($userinfo["fax"])."', '$userinfo[email]', '".addslashes($userinfo["url"])."', '$reg_numbers')");




TEMPLATE FILE: skin1/main/register.tpl

Add these lines after the first shipping address blocvk of code for BOTH Billing and Shipping

BILLING ADDRESS 2:
Code:
<tr valign=middle> <td align=right>{$lng.lbl_address} 2</td> <td></td> <td nowrap> <input type=text name=b_address2 size=32 maxlength=64 value="{$userinfo.b_address2}"> </td> </tr>

SHIPPING ADDRESS 2:
Code:
<tr valign=middle> <td align=right>{$lng.lbl_address} 2</td> <td></td> <td nowrap> <input type=text name=s_address2 size=32 maxlength=64 value="{$userinfo.s_address2}"> </td> </tr>

TEMPLATE FILES:
The following tpl file will need to be modified to include and display the new address lines
skin/mail/
-->order_invoice.tpl USE:: {$order.s_address2} {$order.b_address2}
-->order_notification_admin.tpl USE:: {$order.s_address2} {$order.b_address2}
-->order_notification.tpl USE:: {$order.s_address2} {$order.b_address2}

skin/provider/
-->order_printable.tpl USE:: {$customer.s_address2} {$customer.b_address2}

skin/main/
-->order_invoice.tpl USE:: {$order.s_address2} {$order.b_address2}
-->order_label_print.tpl USE:: {$customer.s_address2} {$customer.b_address2}
-->history_order.tpl USE:: {$customer.s_address2} {$customer.b_address2}
Reply With Quote