Thread: 2 Address Lines
View Single Post
  #12  
Old 03-31-2004, 04:10 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

Hi,

I LOVE this mod, BUT I've just noticed that it has a minor flaw.

In include/register.php, there is some coding that looks like this:

if (empty($s_address)) $s_address = $b_address;

This will automatically fill in address line 1 for the shipping section with the information from address line from the billing section if the customer leaves the shipping section empty.

This code is done for most of the shiping section like city, zip code, state, etc.

But here comes the problem, if you want to do this automatically filling for your newly created s_address2 from this mod, itll look like this:

if (empty($s_address2)) $s_address2 = $b_address2;

The problem is say the customer filled in:

Billing section
Address: 2904 Happy Oaks Rd.
Address 2: Apt# 290

Shipping section
Address: 5810 Sappy Blvd.
Address 2: (he leaves it blank)

Although he left address 2 blank, the xcart will automatically fill it in causing it to become:

Shipping section
Address: 5810 Sappy Blvd.
Address 2: Apt# 290

The same thing will happen if he were to leave the address line 2 blank for the billing section but filled in the address line 2 for the shipping section.

Can someone please tell me the php code to tell xcart to only fill in s_address 2 with b_address 2 IF b_address matches s_address

I tried this:

if (empty($s_address2) & $b_address = $s_address) $s_address2 = $b_address2;

but no success. If someone can get the code, the cart will only fill it in if the first address lines match, otherwise it will correctly leave it empty.


Thanks.
Reply With Quote