Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

restrict new shipping address province and country


tec

Recommended Posts

howdy y'all

 

ok, here is what i need to accomplish

 

i need to be able to restrict the destination when creating a new address for teh shipping address

 

as a user (buyer) their location is not restricted, however, they can ONLY ship to canada...how do i fix the checkout_shipping_address so that when adding a new address for teh receiver, only the canadian provinces show up and only canada for country?

Link to comment
Share on other sites

howdy y'all

 

ok, here is what i need to accomplish

 

i need to be able to restrict the destination when creating a new address for teh shipping address

 

as a user (buyer) their location is not restricted, however, they can ONLY ship to canada...how do i fix the checkout_shipping_address so that when adding a new address for teh receiver, only the canadian provinces show up and only canada for country?

 

I assume you are looking to run a Canadian store only? Not much reason not to if your only allowing shipping to Canada. Anyway fast way is to Delete all countries but Canada in your database, Or you can use your zones and set up ALL your shipping options for Canada only.

 

Chris.

Link to comment
Share on other sites

I assume you are looking to run a Canadian store only? Not much reason not to if your only allowing shipping to Canada. Anyway fast way is to Delete all countries but Canada in your database, Or you can use your zones and set up ALL your shipping options for Canada only.

 

Chris.

 

removing the other countries cannot be done because as a buyer (customer) I can be located anywhere.

I was going to use the shipping zones set up, but the problem with my cart is that the shipping option comes after my checkout_shipping_address page

the customer chooses where they want the product to go, then, on the next page they choose their shipping option.

 

I have this as part of my code...was wondering if there was a way to hardcode zone and country id numbers into it

 

<td class="main"><?php echo ENTRY_STATE; ?></td>
			<td class="main">
<?php
if ($process == true) {
  if ($entry_state_has_zones == true) {
	$zones_array = array();
	$zones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
	$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");(could i not change that red text to read...where zone_country_id = '" . 38 . "'..38 being canadas country id when looking in browser bar)
	  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 {
	$zones_array = array();
	$zones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
	$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " 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 {
	$zones_array = array();
	$zones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
	$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " 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);
}

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?>
			</td>
		  </tr>
<?php
 }
?>
 <tr>
<td class="main"><?php echo ENTRY_COUNTRY; ?></td>
<td class="main"><?php echo tep_get_country_list('country', STORE_COUNTRY, '', false) . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
 </tr>
 <tr>

Link to comment
Share on other sites

hmm...noticed that with putting in code block, you cannot see my red text :)

 

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

<td class="main">

<?php

if ($process == true) {

if ($entry_state_has_zones == true) {

$zones_array = array();

$zones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");

(could i not change that red text to read...where zone_country_id = '" . 38 . "'..38 being canadas country id when looking in browser bar) 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 {

$zones_array = array();

$zones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " 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 {

$zones_array = array();

$zones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " 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);

}

 

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

?>

</td>

</tr>

<?php

}

?>

<tr>

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

<td class="main"><?php echo tep_get_country_list('country', STORE_COUNTRY, '', false) . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>

</tr>

<tr>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...