Jump to content
Sign in to follow this  
enigma1

Active Countries

Recommended Posts

enigma1:

 

thanks a lot for the help, removing that code solve the issue.

 

Most of the things already functioning extemely well for me, thanks a million.

 

Actually I had followed the manual (the html file) and there are even more weird problems, I think its due to some other previous contributions I had added, something to do with default country display and also state drop down menu.

 

Would like some advice here,

 

On the existing customer which already registered before this contribution, the customer cannot change their prefered delivery address. Its like Customer A has registered 4 delivery addresses, and the default one will appear during the first phase of checking out. When select change delivery address, says selecting another address, by normal it should proceed back to the shipping charges section, but it can't. But it can proceed to shipping charges if we dun select to change to another address. So once you have click change another shipping address, that's it, it won't be able to proceed. You will need to click the cart again and have to live with the default address the system displayed.

 

But for newly registered customer, it just function normally. Can change to different addresses registered in the address book.

 

Then is there anyway the country register by the customer could be change when the customer log in to edit their addresses? Is this suppose to function as locked, so the customer cannot change their country, or something I did wrongly.

 

Somehow, I will need a way to delete those additional addresses I added. I used different locations to test if I had set up the shipping zones correctly. Cos I created a login for my self to check if everything functions as intended. Any clue how to do it?

Share this post


Link to post
Share on other sites

The existing entries of the address book are irrelevant. At least trying with the default osc + active countries will allow me to go to checkout shipping after switching between different addresses or inserting new ones to existing accounts. The active countries filters the initial input based on the admin countries/states selections.

 

But existing entries in the address book function as before. I tried it here. I also was able to change addresses right away from the change shipping button and see the order going through with the correct delivery address. The system also switched back to the checkout_shipping.php as I expected. Make sure you deployed v2.00 properly. But of course it could be some other customizations you have.

 

Especially if those, change the behaviour of countries/states.

I think its due to some other previous contributions I had added, something to do with default country display and also state drop down menu.

Because if you have some remnants of other contributions it could explain the problems you're having.

Share this post


Link to post
Share on other sites

Actually I'll take that back. There is a problem when I try to switch the country coming from the shipping page. In catalog\address_book_process.php locate this code

 

$entry = tep_db_fetch_array($entry_query);

//-MS- Added Active Countries

$country = $entry['entry_country_id'];

//-MS- Added Active Countries EOM

 

change it to this:

	$entry = tep_db_fetch_array($entry_query);
//-MS- Added Active Countries
//	$country = $entry['entry_country_id'];
//-MS- Added Active Countries EOM

 

Let me know if that works for you.

 

PS: This is item 5-f from the documentation. I will update it with the next version.

Edited by enigma1

Share this post


Link to post
Share on other sites

Am I correct in understanding that Active Countries replaces the State text input with a drop down menu?

 

if so, is there any easy way to not do that (like skipping all the steps in the Install marked "Enforce State Drop-down")?

 

thanks for the help

 

rj

Share this post


Link to post
Share on other sites
Am I correct in understanding that Active Countries replaces the State text input with a drop down menu?

 

if so, is there any easy way to not do that (like skipping all the steps in the Install marked "Enforce State Drop-down")?

 

thanks for the help

 

rj

countries and states operate with drop-down lists. With v2.00 this is now enforced for all countries. It is also the reason for the world zones sql table within the archive. The idea behind it, are the tax zones associated with the shipping/payment and other modules will always apply. With the default osc when a country does not include zones for example a customer can simply type his "own" zone and get around it with a "tax discount"

 

Now at the top you can switch on/off any country/state based on where your store operates. That will enforce account registration & shipping of goods to those active zones only.

 

So the answer to your question is to deploy the world zones sql table that comes with the contribution. It covers zones from almost every country around the world. Unless I missed something.

Share this post


Link to post
Share on other sites

Hi Mark,

 

I am having problems with your contribution, I have probably done something wrong somewhere!

 

In admin/zones.php i get the following error:

 

1054 - Unknown column 'z.zone_status' in 'field list'

 

select z.zone_id, c.countries_id, c.countries_name, z.zone_name, z.zone_code, z.zone_country_id, z.zone_status from zones z left join countries c on (z.zone_country_id = c.countries_id) where c.countries_status='1' order by c.countries_name, z.zone_name limit 0, 50

 

I am also getting an error in /create_account.php, which shows (in place of the counry):

 

 

1054 - Unknown column 'zone_status' in 'where clause'

 

select zone_id, zone_name from zones where zone_status='1' and zone_country_id = '222' order by zone_name

 

[TEP STOP]

 

 

Could you help? My store is currently live and can not have the problem on there for too long!

Share this post


Link to post
Share on other sites

did you upgrade to v2.00? I did mentioned earlier on there is another query that needs to be executed. It is included in the archive but if you already have v1.x you have to undo the changes and the re-install it. Because many items changed. Anyways here is the sql that you need run for your dbase.

 

ALTER TABLE `zones` ADD `zone_status` tinyint(1) default '1' not null;

Share this post


Link to post
Share on other sites
did you upgrade to v2.00? I did mentioned earlier on there is another query that needs to be executed. It is included in the archive but if you already have v1.x you have to undo the changes and the re-install it. Because many items changed. Anyways here is the sql that you need run for your dbase.

 

ALTER TABLE `zones` ADD `zone_status` tinyint(1) default '1' not null;

 

 

Thank you very much for you extremely quick response, your answer seemd to get everything running fine.

 

I did install version 2.

 

Thanks again, your a top man.

Share this post


Link to post
Share on other sites

Spoke too soon, i get the following error when i click tax zones in admin:

 

Fatal error: Call to undefined function: tep_get_active_countries() in /hsphere/local/*****/********/deviltronics.com/admin/geo_zones.php on line 148

Share this post


Link to post
Share on other sites
Spoke too soon, i get the following error when i click tax zones in admin:

 

Fatal error: Call to undefined function: tep_get_active_countries() in /hsphere/local/*****/********/deviltronics.com/admin/geo_zones.php on line 148

make sure you have these changes

http://forums.oscommerce.com/index.php?s=&...st&p=903178

 

http://forums.oscommerce.com/index.php?s=&...st&p=882355

http://forums.oscommerce.com/index.php?s=&...st&p=909313

Edited by enigma1

Share this post


Link to post
Share on other sites

Hi Enigma:

 

Actually now I am trying to do everything from scratch but I got this problem.

 

On the section on your manual

4. catalog\includes\modules\address_book_details.php

 

both the code needs to be replace is not present from the osCommerce 2.2 Milestone 2 Update 051113

 

maybe you could double check it.

 

As for the previous solution it didn't work out for me :'( that is why I am thinking doing it fresh again from the 2.2M2-051113

Share this post


Link to post
Share on other sites

Sorry earlier I meantion both, actually only the second part, which is below; this is the guidelines in your manual:

 

	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');
}

 

 

This is supposed to be locate but the new file doesn't have this full section, what should I do?

 

Original file is like this: so it doesn't cover the whole section need to be replace , see the near end part

 

<?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', tep_get_zone_name($entry['entry_country_id'], $entry['entry_zone_id'], $entry['entry_state']));
}

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

Edited by hms

Share this post


Link to post
Share on other sites

If you download the catalog\includes\modules\address_book_details.php from here:

http://www.oscommerce.com/solutions/downloads

 

Should be lines 97-110 of that file. The documentation did not list the last else correctly from the original section to be replaced. It will be updated with the next release.

 

Section 4-b should read:

4b) Enforce State Drop-Down: Locate the following code

	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', tep_get_zone_name($entry['entry_country_id'], $entry['entry_zone_id'], $entry['entry_state']));
}

Edited by enigma1

Share this post


Link to post
Share on other sites

Mark,

As requested from post http://forums.oscommerce.com/index.php?sho...mp;#entry910481

 

Again I am only trying to remove the country requirement and would prefer not to have to install a mod. So you don't have to go back and read the previous post, I copied your code and pasted into my file.

 

Your code:

$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);

 

After doing so, I now receive the following error:

Parse error: parse error, unexpected '}' in /home/hrmtx114/hrm-texas-www/catalog/checkout_payment_address.php on line 185

 

Again the errors only started when I attempted to change my billing address. Here is my entire file:

<?php

/*

$Id: checkout_payment_address.php,v 1.1.1.1 2004/01/22 05:37:06 srashinkar Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

 

// needs to be included earlier to set the success message in the messageStack

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT_ADDRESS);

 

$error = false;

$process = false;

if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit')) {

// process a new billing address

if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) && tep_not_null($HTTP_POST_VARS['street_address'])) {

$process = true;

 

if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);

if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);

$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);

$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);

$street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);

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']);

# $country = tep_db_prepare_input($HTTP_POST_VARS['country']);

if (ACCOUNT_STATE == 'true') {

if (isset($HTTP_POST_VARS['zone_id'])) {

$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);

} else {

$zone_id = false;

}

$state = tep_db_prepare_input($HTTP_POST_VARS['state']);

}

 

if (ACCOUNT_GENDER == 'true') {

if ( ($gender != 'm') && ($gender != 'f') ) {

$error = true;

 

$messageStack->add('checkout_address', ENTRY_GENDER_ERROR);

}

}

 

if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {

$error = true;

 

$messageStack->add('checkout_address', ENTRY_FIRST_NAME_ERROR);

}

 

if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {

$error = true;

 

$messageStack->add('checkout_address', ENTRY_LAST_NAME_ERROR);

}

 

if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {

$error = true;

 

$messageStack->add('checkout_address', ENTRY_STREET_ADDRESS_ERROR);

}

 

if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {

$error = true;

 

$messageStack->add('checkout_address', ENTRY_POST_CODE_ERROR);

}

 

if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {

$error = true;

 

$messageStack->add('checkout_address', ENTRY_CITY_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('checkout_address', ENTRY_STATE_ERROR_SELECT);

}

} else {

if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {

$error = true;

 

$messageStack->add('checkout_address', ENTRY_STATE_ERROR);

}

}

}

 

# if ( (is_numeric($country) == false) || ($country < 1) ) {

$error = true;

 

# $messageStack->add('checkout_address', ENTRY_COUNTRY_ERROR);

}

 

if ($error == false) {

$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);

 

 

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;

}

}

 

if (!tep_session_is_registered('billto')) tep_session_register('billto');

 

tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

 

$billto = tep_db_insert_id();

 

if (tep_session_is_registered('payment')) tep_session_unregister('payment');

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}

// process the selected billing destination

} elseif (isset($HTTP_POST_VARS['address'])) {

$reset_payment = false;

if (tep_session_is_registered('billto')) {

if ($billto != $HTTP_POST_VARS['address']) {

if (tep_session_is_registered('payment')) {

$reset_payment = true;

}

}

} else {

tep_session_register('billto');

}

 

$billto = $HTTP_POST_VARS['address'];

 

$check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "' and address_book_id = '" . $billto . "'");

$check_address = tep_db_fetch_array($check_address_query);

 

if ($check_address['total'] == '1') {

if ($reset_payment == true) tep_session_unregister('payment');

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

} else {

tep_session_unregister('billto');

}

// no addresses to select from - customer decided to keep the current assigned address

} else {

if (!tep_session_is_registered('billto')) tep_session_register('billto');

$billto = $customer_default_address_id;

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}

}

 

// if no billing destination address was selected, use their own address as default

if (!tep_session_is_registered('billto')) {

$billto = $customer_default_address_id;

}

 

$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'));

 

$addresses_count = tep_count_customer_address_book_entries();

?>

<!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">

<script language="javascript"><!--

var selected;

 

function selectRowEffect(object, buttonSelect) {

if (!selected) {

if (document.getElementById) {

selected = document.getElementById('defaultSelected');

} else {

selected = document.all['defaultSelected'];

}

}

 

if (selected) selected.className = 'moduleRow';

object.className = 'moduleRowSelected';

selected = object;

 

// one button is not an array

if (document.checkout_address.address[0]) {

document.checkout_address.address[buttonSelect].checked=true;

} else {

document.checkout_address.address.checked=true;

}

}

 

function rowOverEffect(object) {

if (object.className == 'moduleRow') object.className = 'moduleRowOver';

}

 

function rowOutEffect(object) {

if (object.className == 'moduleRowOver') object.className = 'moduleRow';

}

 

function check_form_optional(form_name) {

var form = form_name;

 

var firstname = form.elements['firstname'].value;

var lastname = form.elements['lastname'].value;

var street_address = form.elements['street_address'].value;

 

if (firstname == '' && lastname == '' && street_address == '') {

return true;

} else {

return check_form(form_name);

}

}

//--></script>

<?php require(DIR_WS_INCLUDES . 'form_check.js.php'); ?>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'), 'post', 'onSubmit="return check_form_optional(checkout_address);"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_payment.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

if ($messageStack->size('checkout_address') > 0) {

?>

<tr>

<td><?php echo $messageStack->output('checkout_address'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

 

if ($process == false) {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_PAYMENT_ADDRESS; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

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

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_PAYMENT_DESTINATION; ?></td>

<td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main" align="center" valign="top"><?php echo '<b>' . TITLE_PAYMENT_ADDRESS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" valign="top"><?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

if ($addresses_count > 1) {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_ADDRESS_BOOK_ENTRIES; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

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

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="50%" valign="top"><?php echo TEXT_SELECT_OTHER_PAYMENT_DESTINATION; ?></td>

<td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

$radio_buttons = 0;

 

$addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");

while ($addresses = tep_db_fetch_array($addresses_query)) {

$format_id = tep_get_address_format_id($addresses['country_id']);

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php

if ($addresses['address_book_id'] == $billto) {

echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

} else {

echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

}

?>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" colspan="2"><b><?php echo $addresses['firstname'] . ' ' . $addresses['lastname']; ?></b></td>

<td class="main" align="right"><?php echo tep_draw_radio_field('address', $addresses['address_book_id'], ($addresses['address_book_id'] == $billto)); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td colspan="3"><table border="0" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo tep_address_format($format_id, $addresses, true, ' ', ', '); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

$radio_buttons++;

}

?>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

}

 

if ($addresses_count < MAX_ADDRESS_BOOK_ENTRIES) {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_NEW_PAYMENT_ADDRESS; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

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

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="100%" valign="top"><?php echo TEXT_CREATE_NEW_PAYMENT_ADDRESS; ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<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 require(DIR_WS_MODULES . 'checkout_new_address.php'); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

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

<tr class="infoBoxContents">

<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 class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>

<td class="main" align="right"><?php echo tep_draw_hidden_field('action', 'submit') . tep_image_submit('button_continue.gif', 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>

<?php

if ($process == true) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

</tr>

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

</tr>

</table></td>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

</tr>

</table></td>

<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>

<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>

<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>

<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>

</tr>

</table></td>

</tr>

</table></form></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

Thanks


"If you obey all the rules, you miss all the fun." Katherine Hepburn

Share this post


Link to post
Share on other sites

well I thought you already had the module installed.

 

copied your code into the file, but now I receive the following error:

Parse error: parse error, unexpected '}' in /home/hrmtx114/hrm-texas-www/catalog/checkout_payment_address.php on line 185

 

I cannot predict what will happen if you only copy one file. My guess is that will not work. There are functions that return the active countries configured according to the database so obviously you will get errors.

Share this post


Link to post
Share on other sites

I did not install the mod, I just copied the code.

 

Is there anyway to remove the country prompt without the mod?


"If you obey all the rules, you miss all the fun." Katherine Hepburn

Share this post


Link to post
Share on other sites

not an easy one that I can describe. There are multiple places where the country list shows, so for each case you need to remove the list and somehow enforce usa as the country argument for the forms.

Share this post


Link to post
Share on other sites

So, in my case, probably the best thing is to just go through admin and delete the countries, until only the US remains?


"If you obey all the rules, you miss all the fun." Katherine Hepburn

Share this post


Link to post
Share on other sites
So, in my case, probably the best thing is to just go through admin and delete the countries, until only the US remains?

I would not recommend that. Because you will have to also sync the customer accounts and zones (perhaps the order tables too). Even if you do that you will still endup with the drop-down list for countries with just the us in. It's not going to be a static text. Check the forum I remember seeing a thread about hard-coding us some time ago. It included the steps I think to do this.

Edited by enigma1

Share this post


Link to post
Share on other sites

I'm considering using this contribution, but I don't understand something in the readme:

Note: files included with the contribution are based on a default osC store together with the register globals contribution used to test the Active Countries.

 

I have not used any register globals contribution in my shop. register_globals is "on" on my server. Can I still use this contribution?

 

Thanks.

Share this post


Link to post
Share on other sites

yes use the manual instructions as it is recommended. And check posts #110. #114 for the reported issues with version 2.00.

Share this post


Link to post
Share on other sites

Thank you for this contrib. I followed the manual instructions and replaced the code (version 2.00, and I followed the extra posts about what other changes to make, thanks for pointing them out)... but I seem to have made a mistake, and I don't know where to look for it.

 

The instructions indicate that I should have green/red LEDs in the country listing. I don't. No countries seem to be selected ("country" selection is blank when a new user tries to register, although the asterisk is gone), but in my "State" pulldown there are the states of U.S. (which is what I wanted). I can't create any "zones" probably because I can't assign them to any country.

 

Advice greatly appreciated.

Share this post


Link to post
Share on other sites

So what happens when you go to osc admin->Location/Taxes->Countries. Do you see just a list of countries? You could backup your existing admin\countries.php and try the one from the archive as a test to see if the leds appear.

Share this post


Link to post
Share on other sites
So what happens when you go to osc admin->Location/Taxes->Countries. Do you see just a list of countries? You could backup your existing admin\countries.php and try the one from the archive as a test to see if the leds appear.

 

You replied to my plea for help much too quickly. :grin: (but thank you so much for doing so!) After I posted, I continued to look for the problem (I had already spent probably a good hour trying to figure it out.... ) Well, turns out to have been a problem with my FTP'ing. Somehow :-" I had managed to only upload the /catalog/ files, and not any of the ones in directories below.

 

So weird results ensued, and totally my bad. Or, well, I'm blaming my FTP program. :lol:

 

Thanks again for your very quick response.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×