Thread: 2 Address Lines
View Single Post
  #9  
Old 09-18-2003, 09:02 PM
 
ron33 ron33 is offline
 

Newbie
  
Join Date: Sep 2003
Posts: 5
 

Default

There has to be happen a similar thing with gift certificate recipient addresses too.
- If you use this module and prefer to have 2 address lines there as well.

All the following refers to version x-cart-3.4.7gold.

Quote:
Table xcart_giftcerts has to be amended by a field recipient_address2 after recipient_address.

Then the following changes to the code:

admin/giftcerts.php

change:
Quote:
#
# Send via Postal Mail
#
$fill_error = ($fill_error || empty($recipient_firstname) || empty($recipient_lastname) || empty($recipient_address) ||

empty($recipient_city) || empty($recipient_zipcode) || empty($recipient_state) || empty($recipient_country));

$giftcert = array ("purchaser" => stripslashes($purchaser),
"recipient" => stripslashes($recipient),
"message" => stripslashes($message),
"amount" => $amount,
"send_via" => $send_via,
"recipient_firstname" => stripslashes($recipient_firstname),
"recipient_lastname" => stripslashes($recipient_lastname),
"recipient_address" => stripslashes($recipient_address),
"recipient_city" => stripslashes($recipient_city),
"recipient_zipcode" => $recipient_zipcode,
"recipient_state" => $recipient_state,
"recipient_country" => $recipient_country,
"recipient_phone" => $recipient_phone);
}

to
Quote:
#
# Send via Postal Mail
#
$fill_error = ($fill_error || empty($recipient_firstname) || empty($recipient_lastname) || empty($recipient_address) ||

empty($recipient_city) || empty($recipient_zipcode) || empty($recipient_state) || empty($recipient_country));

$giftcert = array ("purchaser" => stripslashes($purchaser),
"recipient" => stripslashes($recipient),
"message" => stripslashes($message),
"amount" => $amount,
"send_via" => $send_via,
"recipient_firstname" => stripslashes($recipient_firstname),
"recipient_lastname" => stripslashes($recipient_lastname),
"recipient_address" => stripslashes($recipient_address),
"recipient_address2" => stripslashes($recipient_address2),
"recipient_city" => stripslashes($recipient_city),
"recipient_zipcode" => $recipient_zipcode,
"recipient_state" => $recipient_state,
"recipient_country" => $recipient_country,
"recipient_phone" => $recipient_phone);
}

change in:
Quote:
#
# If gcindex is empty - add
# overwise - update
#
.
.
db_query("insert into $sql_tbl[giftcerts] (gcid, orderid, purchaser, recipient, send_via, recipient_email, recipient_firstname, recipient_lastname,

recipient_address, recipient_city, recipient_state, recipient_country, recipient_zipcode, recipient_phone, message, amount, debit, status, add_date) values

('$gcid',

'0','".addslashes($giftcert[purchaser])."','".addslashes($giftcert[recipient])."','$giftcert[send_via]','$giftcert[recipient_email]','".addslashes($giftcert

[recipient_firstname])."','".addslashes($giftcert[recipient_lastname])."','".addslashes($giftcert[recipient_address])."','".addslashes($giftcert[recipient_c

ity])."','$giftcert[recipient_state]','$giftcert[recipient_country]','$giftcert[recipient_zipcode]','$giftcert[recipient_phone]','".addslashes($giftcert[mes

sage])."','$giftcert[amount]','$giftcert[amount]','P','".time()."')");

to:
Quote:
db_query("insert into $sql_tbl[giftcerts] (gcid, orderid, purchaser, recipient, send_via, recipient_email, recipient_firstname, recipient_lastname,

recipient_address, recipient_address2, recipient_city, recipient_state, recipient_country, recipient_zipcode, recipient_phone, message, amount, debit,

status, add_date) values ('$gcid',

'0','".addslashes($giftcert[purchaser])."','".addslashes($giftcert[recipient])."','$giftcert[send_via]','$giftcert[recipient_email]','".addslashes($giftcert

[recipient_firstname])."','".addslashes($giftcert[recipient_lastname])."','".addslashes($giftcert[recipient_address])."','".addslashes($giftcert[recipient_a

ddress2])."','".addslashes($giftcert[recipient_city])."','$giftcert[recipient_state]','$giftcert[recipient_country]','$giftcert[recipient_zipcode]','$giftce

rt[recipient_phone]','".addslashes($giftcert[message])."','$giftcert[amount]','$giftcert[amount]','P','".time()."')");




in customer/giftcert.php:

change:
Quote:
#
# Send via Postal Mail
#
$fill_error = ($fill_error || empty($recipient_firstname) || empty($recipient_lastname) || empty($recipient_address) || empty($recipient_city) ||

empty($recipient_zipcode) || empty($recipient_state) || empty($recipient_country));

$giftcert = array ("purchaser" => stripslashes($purchaser),
"recipient" => stripslashes($recipient),
"message" => stripslashes($message),
"amount" => $amount,
"send_via" => $send_via,
"recipient_firstname" => stripslashes($recipient_firstname),
"recipient_lastname" => stripslashes($recipient_lastname),
"recipient_address" => stripslashes($recipient_address),
"recipient_city" => stripslashes($recipient_city),
"recipient_zipcode" => $recipient_zipcode,
"recipient_state" => $recipient_state,
"recipient_country" => $recipient_country,
"recipient_phone" => $recipient_phone);
}

to:
Quote:
#
# Send via Postal Mail
#
$fill_error = ($fill_error || empty($recipient_firstname) || empty($recipient_lastname) || empty($recipient_address) || empty($recipient_city) ||

empty($recipient_zipcode) || empty($recipient_state) || empty($recipient_country));

$giftcert = array ("purchaser" => stripslashes($purchaser),
"recipient" => stripslashes($recipient),
"message" => stripslashes($message),
"amount" => $amount,
"send_via" => $send_via,
"recipient_firstname" => stripslashes($recipient_firstname),
"recipient_lastname" => stripslashes($recipient_lastname),
"recipient_address" => stripslashes($recipient_address),
"recipient_address2" => stripslashes($recipient_address2),
"recipient_city" => stripslashes($recipient_city),
"recipient_zipcode" => $recipient_zipcode,
"recipient_state" => $recipient_state,
"recipient_country" => $recipient_country,
"recipient_phone" => $recipient_phone);
}


in include/func.php:

change:
Quote:
#
# status == Pending!
#
db_query("insert into $sql_tbl[giftcerts] (gcid, orderid, purchaser, recipient, send_via, recipient_email,

recipient_firstname, recipient_lastname, recipient_address, recipient_city, recipient_state, recipient_country, recipient_zipcode, recipient_phone, message,

amount, debit, status, add_date) values ('$gcid',

'$orderid','".addslashes($giftcert[purchaser])."','".addslashes($giftcert[recipient])."','$giftcert[send_via]','$giftcert[recipient_email]','".addslashes($g

iftcert[recipient_firstname])."','".addslashes($giftcert[recipient_lastname])."','".addslashes($giftcert[recipient_address])."','".addslashes($giftcert[reci

pient_city])."','$giftcert[recipient_state]','$giftcert[recipient_country]','$giftcert[recipient_zipcode]','$giftcert[recipient_phone]','".addslashes($giftc

ert[message])."','$giftcert[amount]','$giftcert[amount]','P','".time()."')");

to:
Quote:
#
# status == Pending!
#
db_query("insert into $sql_tbl[giftcerts] (gcid, orderid, purchaser, recipient, send_via, recipient_email,

recipient_firstname, recipient_lastname, recipient_address, recipient_address2, recipient_city, recipient_state, recipient_country, recipient_zipcode,

recipient_phone, message, amount, debit, status, add_date) values ('$gcid',

'$orderid','".addslashes($giftcert[purchaser])."','".addslashes($giftcert[recipient])."','$giftcert[send_via]','$giftcert[recipient_email]','".addslashes($g

iftcert[recipient_firstname])."','".addslashes($giftcert[recipient_lastname])."','".addslashes($giftcert[recipient_address])."','".addslashes($giftcert[reci

pient_address2])."','".addslashes($giftcert[recipient_city])."','$giftcert[recipient_state]','$giftcert[recipient_country]','$giftcert[recipient_zipcode]','

$giftcert[recipient_phone]','".addslashes($giftcert[message])."','$giftcert[amount]','$giftcert[amount]','P','".time()."')");

In skin1/modules/Gift_Certificates/giftcert.tpl:
shortly after the statement group around line 231 about the address line add the following:
Quote:
<tr>
<td nowrap align=right>{$lng.lbl_address}</td>
<td> </font></td>
<td align=left><input type=text name=recipient_address size=40 value="{$giftcert.recipient_address2}"></td>
</tr>

In skin1/modules/Gift_Certificates/giftcert_static.tpl:
shortly after the statement group around line 90 about the address line add the following:
Quote:
<tr>
<td nowrap align=right>{$lng.lbl_address}:</td>
<td></td>
<td align=left>
{$giftcert.recipient_address2|escape:"htmlall"}
</td>
</tr>

In skin1/main/history_order.tpl:
around line 90 change:
Quote:
<tr>
<td valign="top" class="LabelStyle">{$lng.lbl_mail_address}</td>
<td valign="top">
{$giftcerts[giftcert].recipient_firstname} {$giftcerts[giftcert].recipient_lastname}

{$giftcerts[giftcert].recipient_address}, {$giftcerts[giftcert].recipient_city},

{$giftcerts[giftcert].recipient_state} {$giftcerts[giftcert].recipient_country}, {$giftcerts[giftcert].recipient_zipcode}
</td>
</tr>

to:
Quote:
<tr>
<td valign="top" class="LabelStyle">{$lng.lbl_mail_address}</td>
<td valign="top">
{$giftcerts[giftcert].recipient_firstname} {$giftcerts[giftcert].recipient_lastname}

{$giftcerts[giftcert].recipient_address}, {$giftcerts[giftcert].recipient_address2},

{$giftcerts[giftcert].recipient_city},

{$giftcerts[giftcert].recipient_state} {$giftcerts[giftcert].recipient_country}, {$giftcerts[giftcert].recipient_zipcode}
</td>
</tr>

I hope I did not oversee something.
Reply With Quote