Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tep_get_cat_zone_name()


KemoSabe

Recommended Posts

after installing this mod i stumbled across an error message. something that i was hopeing not to encounter.

 

Shipping Zones

Fatal error: Call to undefined function: tep_get_cat_zone_name() in .../catalog/admin/shipping_zones.php on line 233

 

i can't edit, delete, insert or view details of an item in "Shipping Zones" located in "Locations / Taxes".

 

is it a SQL problem?

Edited by KemoSabe
Link to comment
Share on other sites

<?php 
 echo HEADING_TITLE; 
 if (isset($HTTP_GET_VARS['zID']) && tep_not_null($HTTP_GET_VARS['zID']) ) 
echo ' » ' . tep_get_cat_zone_name($HTTP_GET_VARS['zID']);
?>

 

by deleting this code from line 276 i seem to have got it working.

 

???

 

is this a bad idea?

Link to comment
Share on other sites

yes it is,

 

It is missing from the documentation. Item 3 should read:

 

//-MS Active Shipping Added
 function tep_cfg_pull_down_active_zones($zone_id, $key = '') {
$name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');

$zone_array = array(array('id' => '0', 'text' => TEXT_NONE));
$zone_query = tep_db_query("select cat_zone_id, cat_zone_name from " . TABLE_CAT_ZONES . " order by cat_zone_name");

while ($zone = tep_db_fetch_array($zone_query)) {
  $zone_array[] = array('id' => $zone['cat_zone_id'],
						'text' => $zone['cat_zone_name']);
}
return tep_draw_pull_down_menu($name, $zone_array, $zone_id);
 }

 function tep_get_active_zone_title($zone_id) {
if ($zone_id == '0') {
  return TEXT_NONE;
} else {
  $zone_query = tep_db_query("select cat_zone_name from " . TABLE_CAT_ZONES . " where cat_zone_id = '" . (int)$zone_id . "'");
  $zone = tep_db_fetch_array($zone_query);

  return $zone['cat_zone_name'];
}
 }

 function tep_get_cat_zone_name($cat_zone_id, $default_zone='Unknown Zone') {
$zone_query = tep_db_query("select cat_zone_name from " . TABLE_CAT_ZONES . " where cat_zone_id = '" . (int)$cat_zone_id . "'");
if (tep_db_num_rows($zone_query)) {
  $zone = tep_db_fetch_array($zone_query);
  return $zone['cat_zone_name'];
} else {
  return $default_zone;
}
 }
//-MS Active Shipping Added EOM

 

I will make a note on the support thread

http://www.oscommerce.com/forums/index.php?showtopic=219998

and update it with the next version

Link to comment
Share on other sites

yes it is,

 

It is missing from the documentation. Item 3 should read:

 

//-MS Active Shipping Added
 function tep_cfg_pull_down_active_zones($zone_id, $key = '') {
$name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');

$zone_array = array(array('id' => '0', 'text' => TEXT_NONE));
$zone_query = tep_db_query("select cat_zone_id, cat_zone_name from " . TABLE_CAT_ZONES . " order by cat_zone_name");

while ($zone = tep_db_fetch_array($zone_query)) {
  $zone_array[] = array('id' => $zone['cat_zone_id'],
						'text' => $zone['cat_zone_name']);
}
return tep_draw_pull_down_menu($name, $zone_array, $zone_id);
 }

 function tep_get_active_zone_title($zone_id) {
if ($zone_id == '0') {
  return TEXT_NONE;
} else {
  $zone_query = tep_db_query("select cat_zone_name from " . TABLE_CAT_ZONES . " where cat_zone_id = '" . (int)$zone_id . "'");
  $zone = tep_db_fetch_array($zone_query);

  return $zone['cat_zone_name'];
}
 }

 function tep_get_cat_zone_name($cat_zone_id, $default_zone='Unknown Zone') {
$zone_query = tep_db_query("select cat_zone_name from " . TABLE_CAT_ZONES . " where cat_zone_id = '" . (int)$cat_zone_id . "'");
if (tep_db_num_rows($zone_query)) {
  $zone = tep_db_fetch_array($zone_query);
  return $zone['cat_zone_name'];
} else {
  return $default_zone;
}
 }
//-MS Active Shipping Added EOM

 

I will make a note on the support thread

http://www.oscommerce.com/forums/index.php?showtopic=219998

and update it with the next version

 

Thank you so much.

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...