Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PostCode Anywhere with OSCommerce


skipunda

Recommended Posts

Hi all,

 

This is my first post and must admit have spent some time trying to work this out myself, with good success with standard html forms, sending this data to a database and reading from the database later...I've run into problems though with oscommerce because of the chunk of php associated with it and so many unused add-ons and templates that litter the site like yesterdays jam.

 

 

Feel free to check out the site: www.bluebanana.cc

 

So,

 

I want to integrate PostCode Anywhere in to my OSCommerce site. What I want the customer to be able to do is select their address which then populates our php form. If they dont want to use the address finder then that is no problem, the fields will always be available.

Please take note of the field names used, maybe by importing the below code into a test server, dreamweaver etc

 

 

Heres the code. I store this in an external file to protect the account and license numbers :D Put this in the head to link to:

<?php require('includes/address_finder.php'); ?>

 

 

EXTERNAL FILE - address_finder.php

<?php

/*
 Note: This script has been developed for .php version 4.2.3.
 .php version 4.3 has more options to parse xml properly with slightly modified functions.

 This script will let you lookup an address from a postcode.

 !!NOTE: Since this example uses the XML service, fields will only be available in the results
 if a value is present i.e. they are not null. If this causes problems the Recordset service
 can be used instead - just modify the PrepareData function below to strip out the different
 characters in the response.
*/

//enter you account code and license key
$ACCOUNTCODE = "ENTER CODE HERE";
$LICENSEKEY = "1111-1111-1111-1111";

function ByPostcode($SearchPostcode){

  global $ACCOUNTCODE,$LICENSEKEY;

  /* Build up the URL to send the request to. */
  $sURL = "http://services.postcodeanywhere.co.uk/xml.aspx?";
  $sURL .= "account_code=" . urlencode($ACCOUNTCODE);
  $sURL .= "&license_code=" . urlencode($LICENSEKEY);
  $sURL .= "&action=lookup";
  $sURL .= "&type=by_postcode";
  $sURL .= "&postcode=" . urlencode($SearchPostcode);

  PrepareData($sURL);

}

function FetchAddress($AddressID){

  global $ACCOUNTCODE, $LICENSEKEY;

  /* Build up the URL to request the data from. */
  $sURL = "http://services.postcodeanywhere.co.uk/xml.aspx?";
  $sURL .= "account_code=" . urlencode($ACCOUNTCODE);
  $sURL .= "&license_code=" . urlencode($LICENSEKEY);
  $sURL .= "&action=fetch";
  $sURL .= "&style=simple";
  $sURL .= "&id=" . $AddressID;

  PrepareData($sURL);

}

function PrepareData($URL){

  global $Data;

  /* Open the URL into a file */
  $ContentsFetch=file("$URL");

  foreach ($ContentsFetch as $line_num => $line) {
  if (strpos($line,"<Item ")!=false) { $Contents[]= $line;}
  }

  for ($i=0;$i<count($Contents);$i++) {

  /* Strip out "<Item " and " />" from the XML */
  $Contents[$i]=substr($Contents[$i], 6+strpos($Contents[$i],"<Item "));
  $Contents[$i]=substr($Contents[$i], 0, strlen($Contents[$i])-4);
  $breakapart=explode("\"",$Contents[$i]);

  /* Extract field names and values */
  for ($x=0;$x<count($breakapart);$x++){
	 if ($x % 2 == 0){
		$k=trim(str_replace("=", "", $breakapart[$x]));
		if ($k!='') { $Data[$i][$k]=$breakapart[$x+1]; }
	 }

  }

  }

}

?>

 

 

This is how to ask and return

 

		 <!-- cc begin address finder -->

<?php

if (isset($_POST['address'])) {

  FetchAddress($_POST['address']);   



  if(count($Data)==0){
  echo "<br><h3>Sorry, there was an error fetching your address. Please try again.</h3>";
  }

  else{

  /*
  We can loop through the records as there is only one returned.
  The address can now be stored in a database, but here we'll display it in a form.
  */

  echo "<table>\n";

  foreach ($Data as $keyd => $data) {


   $street_address1 = $data["line1"];
   $street_address2 = $data["line2"];
   $street_address3 = $data["line3"];
   $street_address4 = $data["line4"];
   $line5 = $data["line5"];
   $city = $data["town"];
   $state = $data["county"];
   $postcode = $data["postcode"];

	 echo "<tr>\n";
	 echo "<td>b</td><td><input type=\"text\" value=\"$street_address1\"></td>\n";
	 echo "</tr>\n";
	 echo "<tr>\n";
	 echo "<td>c</td><td><input type=\"text\" value=\"$street_address2\"></td>\n";
	 echo "</tr>\n";
	 echo "<tr>\n";
	 echo "<td>d</td><td><input type=\"text\" value=\"$street_address3\"></td>\n";
	 echo "</tr>\n";
	 echo "<tr>\n";
	 echo "<td>e</td><td><input type=\"text\" value=\"$street_address4\"></td>\n";
	 echo "</tr>\n";
	 echo "<tr>\n";
	 echo "<td>f</td><td><input type=\"text\" value=\"$line5\"></td>\n";
	 echo "</tr>\n";
	 echo "<tr>\n";
	 echo "<td>g</td><td><input type=\"text\" value=\"$city\"></td>\n";
	 echo "</tr>\n";
	 echo "<tr>\n";
	 echo "<td>h</td><td><input type=\"text\" value=\"$state\"></td>\n";
	 echo "</tr>\n";
	 echo "<tr>\n";
	 echo "<td>i</td><td><input type=\"text\" value=\"$postcode\"></td>\n";
	 echo "</tr>\n";

  }

  echo "</table>";

  }

}
elseif (isset($_POST['postcode'])) {

  $postcode = $_POST['postcode'];

  ByPostcode("$postcode");

  /*
  $Data is populated with 
id
seq(uence)
description
  */

  if(count($Data)==0){
  echo "<br><h3>No results were found for $postcode.  Please try another postcode.</h3>";
  }

  else{

  echo "Please select your address: \n";
  echo "<select name=\"address\" id=\"address\">\n";

  foreach ($Data as $keyd => $data) {
	 echo "<option value=\"" . $data["id"] . "\">" . trim($data["description"]) . "</option>\n";
  }

  echo "</select>\n";
  echo "<br><input type=submit value=\"Select this address\">";

  }

}
else {



echo "Postcode: <input name=\"postcode\" value=\"\" type=\"text\" size=\"10\">\n";

echo "<input id=\"btnFind\" type=\"submit\" value=\"Find\">\n";

}

?> 
<!-- cc end address finder -->

 

 

 

And this is our OSComm page where I want to put this

 

<?php
/*
 $Id: create_account.php,v 1.65 2003/06/09 23:03:54 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
 setcookie("in_new_acc","1",time()+60);
// needs to be included earlier to set the success message in the messageStack
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);

 $process = false;
 if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
$process = true;

if (ACCOUNT_GENDER == 'true') {
  if (isset($HTTP_POST_VARS['gender'])) {
	$gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
  } else {
	$gender = false;
  }
}
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
  // $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
 /*
$names=explode(" ",$firstname);
$firstname="";
for ($z=0;$z<(count($names)-1);$z++) {
	$firstname.=$names[$z]." ";
}
$firstname=trim($firstname);
if (count($names)>1) $lastname=$names[count($names)-1];
*/

$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
$street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address1'])."\n".tep_db_prepare_input($HTTP_POST_VARS['street_address2'])."\n".tep_db_prepare_input($HTTP_POST_VARS['street_address3']);
if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
$postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
$city = tep_db_prepare_input($HTTP_POST_VARS['city']);
if (ACCOUNT_STATE == 'true') {
  $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
  if (isset($HTTP_POST_VARS['zone_id'])) {
	$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
  } else {
	$zone_id = false;
  }
}
$country = tep_db_prepare_input($HTTP_POST_VARS['country']);
$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
if (isset($HTTP_POST_VARS['newsletter'])) {
  $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
} else {
  $newsletter = false;
}
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
$confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);

$error = false;



if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}


if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
} elseif (tep_validate_email($email_address) == false) {
  $error = true;

  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
  $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
  $check_email = tep_db_fetch_array($check_email_query);
  if ($check_email['total'] > 0) {
	$error = true;

	$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
  }
}

if (!$_POST["same_delivery"]) {

if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR);
}

if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
}

if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_CITY_ERROR);
}

if (is_numeric($country) == false) {
  $error = true;

  $messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
}

if (ACCOUNT_STATE == 'true') {
  $zone_id = 0;
  $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
  $check = tep_db_fetch_array($check_query);
  $entry_state_has_zones = ($check['total'] > 0);
  if ($entry_state_has_zones == true) {
	$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
	if (tep_db_num_rows($zone_query) == 1) {
	  $zone = tep_db_fetch_array($zone_query);
	  $zone_id = $zone['zone_id'];
	} else {
	  $error = true;

	  $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
	}
  } else {
	if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
	  $error = true;

	  $messageStack->add('create_account', ENTRY_STATE_ERROR);
	}
  }
}
}
else {
	//$street_address="N/A";
}
if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
}


if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
} elseif ($password != $confirmation) {
  $error = true;

  $messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
}

if ($error == false) {
  $sql_data_array = array('customers_firstname' => $firstname,
						  'customers_lastname' => $lastname,
						  'customers_email_address' => $email_address,
						  'customers_telephone' => $telephone,
						  'customers_fax' => $fax,
						  'customers_newsletter' => !$newsletter,
						  'customers_password' => tep_encrypt_password($password));

  if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;


  tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

  $customer_id = tep_db_insert_id();

  $sql_data_array = array('customers_id' => $customer_id,
						  'entry_firstname' => $firstname,
						  'entry_lastname' => $lastname,
						  'entry_street_address' => $street_address,
						  'entry_postcode' => $postcode,
						  'entry_city' => $city,
						  'entry_country_id' => $country);

  if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
  if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
  if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
  if (ACCOUNT_STATE == 'true') {
	if ($zone_id > 0) {
	  $sql_data_array['entry_zone_id'] = $zone_id;
	  $sql_data_array['entry_state'] = '';
	} else {
	  $sql_data_array['entry_zone_id'] = '0';
	  $sql_data_array['entry_state'] = $state;
	}
  }

  tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

  $address_id = tep_db_insert_id();

  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");

  tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");

  if (SESSION_RECREATE == 'True') {
	tep_session_recreate();
  }

  $customer_first_name = $firstname;
  $customer_default_address_id = $address_id;
  $customer_country_id = $country;
  $customer_zone_id = $zone_id;
  tep_session_register('customer_id');
  tep_session_register('customer_first_name');
  tep_session_register('customer_default_address_id');
  tep_session_register('customer_country_id');
  tep_session_register('customer_zone_id');

// restore cart contents
  $cart->restore_contents();
// restore wishlist to sesssion
	$wishList->restore_wishlist();

// build the message content
  $name = $firstname . ' ' . $lastname;

  if (ACCOUNT_GENDER == 'true') {
	 if ($gender == 'm') {
	   $email_text = sprintf(EMAIL_GREET_MR, $lastname);
	 } else {
	   $email_text = sprintf(EMAIL_GREET_MS, $lastname);
	 }
  } else {
	$email_text = sprintf(EMAIL_GREET_NONE, $firstname);
  }

  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

  $email_text="Hi $firstname!<br>

Thanks for choosing Blue Banana - the UK's largest alternative clothing retailer of brand t-shirts, tops, hoodies, shoes, dresses, jackets and jeans, band merchandise and plenty more!

Your login details are below:

Email: $email_address
Password: $password

Now you're part of Blue Banana's community, you've access to our growing list of clothing and accessories 24 hours a day.  Find out more about us, our newsletter and our frequent web-only offers by checking out our website.

We hope you've found something in our latest offers.  And if you need to contact us about an order, our team is always here to answer questions at [email protected].

Happy Shopping!

The Blue Banana Web Team
";

  tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

  if ($same_delivery) tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
  else {
	  tep_redirect(tep_href_link('add_shipping_address.php', '', 'SSL'));
  }
}
 }

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php require('includes/form_check.js.php'); ?>
<?php require('includes/address_finder.php'); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- MIDDLE COLUMNS - LEFT,  CONTENT, RIGHT -->
 <tr>  
<!-- LEFT COLUMN -->  
<td width="155" valign="top" bgcolor="black">
	<?php require(DIR_WS_INCLUDES . 'column_left_search.php'); ?>	
	<?php require(DIR_WS_INCLUDES . 'column_left_menu.php'); ?>	
	<?php require(DIR_WS_INCLUDES . 'column_left_banners.php'); ?>	

</td>

<td width="2" valign="top" class="spaces"><img width="2" height="1" src="images/spacer.gif" align="absmiddle"></td>

<!-- CENTER COLUMN -->	
<td width="646" align="center" valign="top" bgcolor="#FFFFFF">

<!-- body_text //-->
<?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', '') . tep_draw_hidden_field('action', 'process'); ?>
<table border="0" width="633" cellspacing="0" cellpadding="0" align="center">
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 if ($messageStack->size('create_account') > 0) {
?>
  <tr>
	<td class="checkout_bg_text"><?php echo $messageStack->output('create_account'); ?></td>
  </tr>
  <tr>
	<td class="checkout_bg_text"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

	</table></td>
  </tr>


<!-- cc add image to top -->
  <tr><td width="633" colspan="4"><img src="images/contact_info_01.png"></td></tr>
<!-- /cc -->


  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="checkout_bg_text">
	  <tr>
		<td><table border="0" cellspacing="2" cellpadding="2">

		<tr>
		<td class="checkout_text" colspan=4><p><b><b><span style='font-size: 15px;'>Contact Info </span><br> 
		  This information is used to contact you, the person who placed the order </b><b></b><br>
		</b></p>			  </td>
	  </tr>



		<tr>
		<td class="checkout_text" colspan=4><span class="inputRequirement"><?php echo FORM_REQUIRED_INFORMATION; ?></span></td>
	  </tr>


<?php
 if (ACCOUNT_GENDER == 'true') {
?>

			 <tr>
			<td width="157" class="checkout_bg_text">Title (Mr, Mrs, Miss etc.)</td>
				<td width="8"><span class="inputRequirement">*</span></td>
			<td width="74" class="checkout_bg_text"><?php echo  tep_draw_input_field('gender'); ?></td>
<td width="362"></td>
		  </tr>
<?php
 }
?>


		  <tr>
			<td class="checkout_bg_text">My Name: </td>
			<td></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field(''); ?></td>
				<td></td>	  
		  </tr>


	   <!--	<tr>
			<td class="checkout_bg_text">Your Last Name:</td>
			<td><span class="inputRequirement">*</span></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('lastname'); ?></td>
		  <td></td>
		  </tr> -->
		  <input type=hidden name="lastname" value="">

		<!-- begin sbirthdate

		  <tr>
			<td class="checkout_bg_text">Your Date of Birth</td>
			<td><span class="inputRequirement">*</span></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('dob') . ' </td>' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<td class="inputRequirement">* (e.g. 21/05/1970)</span>': ''); ?></td>
		  </tr>

		 end birthdate -->

		  <tr>
			<td class="checkout_bg_text">Contact Phone:</td>
			<td><span class="inputRequirement">*</span></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('telephone'); ?></td>
			<td></td>
		  </tr>
		  <tr>
			<td class="checkout_bg_text">Optional Phone:</td>
			<td></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('fax'); ?></td>
				<td></td>	  
		  </tr>


		  <tr>
		  <td height="25" colspan="2"> </td>
		  </tr>

		  <tr>
			<td class="checkout_bg_text">Your Email:</td>
			<td><span class="inputRequirement">*</span></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('email_address'); ?></td>
		  <td>Email login  allows you to continue your order at a later time</td>
		  </tr>

		  <tr>
			<td valign="top" nowrap class="checkout_bg_text">Create a Password:</td>
			<td valign="top"><span class="inputRequirement">*</span></td>
			<td valign="top" class="checkout_bg_text"><?php echo tep_draw_password_field('password') . '</td><td class="inputRequirement"></span>'; ?></td>
		  </tr>

		  <tr>
			<td valign="top" nowrap class="checkout_bg_text">Re-enter Password:</td>
			<td valign="top"><span class="inputRequirement">*</span></td>
			<td valign="top" class="checkout_bg_text"><?php echo tep_draw_password_field('confirmation'); ?></td>
			</tr>


		  <tr>
		<td class="checkout_text" colspan=4> </td>
	  </tr>

	  <tr>
		<td class="checkout_text" colspan=4><p><b><b><span style='font-size: 15px;'>Card Holders Billing Address</span><br>
Billing a</b><b>ddress must appear as it does on your credit card statement for the order to be processed</b><br>
		</b></p>			  </td>
	  </tr>

	  <tr>
			<td class="checkout_bg_text"><strong>Card Holders Name </strong></td>
			<td><span class="inputRequirement">*</span></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('firstname'); ?></td>
	 <td>


	 </td>
		  </tr>



	   <tr>
			<td class="checkout_bg_text">Address 1 </td>
			<td></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('$street_address1') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?> 

			</td>
				<td></td>	  
		  </tr>



		  <tr>
			<td class="checkout_bg_text">Address 2 </td>
			<td></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('$street_address2') . ' '; ?></td>
				<td></td>	  
		  </tr>



		  <tr>
			<td class="checkout_bg_text">Address 3 </td>
			<td></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('street_address3') . ' '; ?></td>
				<td></td>	  
		  </tr>




		  <tr>
			<td class="checkout_bg_text">Town/City</td>
			<td></td>
			<td class="checkout_bg_text">

			<?php echo tep_draw_input_field('city') . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>



				<td></td>	  
		  </tr>


		  <tr>
			<td class="checkout_bg_text">County</td>
			<td></td>
			<td class="checkout_bg_text"><?php
if ($process == true) {
  if ($entry_state_has_zones == true) {
	$zones_array = array();
	$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
	while ($zones_values = tep_db_fetch_array($zones_query)) {
	  $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
	}
	echo tep_draw_pull_down_menu('state', $zones_array);
  } else {
	echo tep_draw_input_field('state');
  }
} else {
  echo tep_draw_input_field('state');
}

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?></td>
				<td></td>	  
		  </tr>




		  <tr>
			<td class="checkout_bg_text"><?php echo ENTRY_COUNTRY; ?></td>
			<td></td>
			<td class="checkout_bg_text"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
				<td></td>	  
		  </tr>



		  <tr>
			<td class="checkout_bg_text"><?php echo ENTRY_POST_CODE; ?></td>
			<td></td>
			<td class="checkout_bg_text"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
				<td>




				</td>	  
		  </tr>




		<tr><td colspan=3>



		</td></tr>
			<tr><td colspan=3>



			<tr>
		<td class="checkout_text" colspan=4><p><b><b><span style='font-size: 15px;'>Delivery Address </span><br> 
		  Is the address above also where you'd like your items delivered?
</b><b></b><br>
		</b></p>			  </td>
	  </tr>


		   <tr>
			<td class="checkout_bg_text"> </td>
			<td></td>
			<td class="checkout_bg_text"><input type=radio name="same_delivery" value=1 onClick="var a=returnObjById('dev_add'); a.style.display='none';" checked>Yes <input type=radio name="same_delivery" value=0 onClick="var a=returnObjById('dev_add'); a.style.display='block';">No</td>
				<td></td>
		  </tr>

<tr>
		<td class="checkout_text" colspan=4> </td>
	  </tr>



		<tr>
			<td class="checkout_bg_text" valign=top><strong>Can email?</strong><br>				</td>
					<td></td>

			<td class="checkout_bg_text" valign=top><input type=radio name="contact_sms" value=1 checked>Yes <input type=radio name="contact_sms" value=0>No</td>
	   		<td valign=top><span class='inputRequirement'>Would you like to receive emails about special offers, new stock and more?</span></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
	  <tr>
	<td><table border="0" width="100%" cellspacing="5" cellpadding="2" class="checkout_bg_text">
	  <tr>
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td><?php echo tep_image_submit('button_continue.png', IMAGE_BUTTON_CONTINUE); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
</table></form>
<!-- body_text_eof //-->
</td>	
<td width="2" valign="top" class="spaces"><img width="2" height="1" src="images/spacer.gif" align="absmiddle"></td>

<!-- RIGHT COLUMN -->	
<td width="155"  valign="top" class="rightbar">
	<?php require(DIR_WS_INCLUDES . 'column_right_shopping_card.php'); ?>
	<?php require(DIR_WS_INCLUDES . 'column_right_best_sellers.php'); ?>
	<?php require(DIR_WS_INCLUDES . 'column_right_banners.php'); ?>
</td>
 </tr>
 <tr>
<td colspan="5" width="960" height="2" valign="bottom" class="spaces"><img width="1" height="2" src="images/spacer.gif" align="absmiddle"></td>
 </tr>	

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

  • 1 year later...

Oh just thought I'd reiterate that I've had a really good look over the web for this integration so any help on the matter would go an awful long way, for quite a lot of people I reckon.

 

Many Thanks

:huh:

 

I like the idea of this, and the but is this!!!! obviously the developer doesnt know what OSC stands for Open Source so why should we sign up for an account with him and pay money to use this addon, not very open source if you ask me. Is ANY ONE willing to work with me to get this working FOC like it should be? pvt me your interest.

 

Im talking about UK Postcode Address Finder

 

This contribution is free to use in demo mode. To go live you will need to sign up for an account at www.craftyclicks.co.uk.

Edited by scorp
Link to comment
Share on other sites

Access to up-to-date UK Postcode data through these companies is always on a charge for basis. Royal Mail collect revenue from these licensed companies, that is why you need an account with craftyclicks.

 

You as a shop owner pay for a service/feature that you offer to your customers. You wouldn't expect PayPal to process payments for free just because osCommerce is an open source cart.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...