Thread: 2 Address Lines
View Single Post
  #15  
Old 05-16-2004, 10:39 AM
  1CNS's Avatar 
1CNS 1CNS is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Los Angeles, CA, USA
Posts: 45
 

Default

To answer my own question above (originally asked by xcell67), here's the necessary logic to have two-line address entry that correctly deals with differences in the shipping and billing address (1 vs. 2 line address).

In includes/register.php, find the section below and modify it as shown in the comments with the designation VJ. I first modified register_billing_address.tpl and register_shipping_address.tpl to use company as the second billing address line and fax as the second shipping address line, but if you used different variables, adjust the code below accordingly.

With this code, a customer can enter two address lines in the billing address and one address line in the shipping address, and not have the second billing address line automatically added to the shipping address (as would happen if you used s_title and b_title, as I had originally). A missing shipping address will still be copied correctly in full.

Code:
# # 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); # VJ integrate address 2 variables (billing address 2=company ; shipping address 2=fax) if (empty($s_address) && empty($fax) && empty($s_city) && empty($s_zipcode)) { # VJ old if (empty($s_address) && empty($s_city) && empty($s_zipcode)) { $fax = $company; # VJ end $s_state = $b_state; $s_country = $b_country; } # VJ added next line if (empty($s_address) && empty($fax)) $fax = $company; if (empty($s_address)) $s_address = $b_address; if (empty($s_city)) $s_city = $b_city; if (empty($s_zipcode)) $s_zipcode = $b_zipcode;
__________________
www.funkymart.com
x-cart 4.2.1 [linux]
Reply With Quote