Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Active Countries


Guest

Recommended Posts

Hi there... To begin with - a fantastic contribution, just what (I didn't know) I needed!!! THANKS!!!

 

What I'm wondering is - is anyone using it with 'Ship in Cart' (http://www.oscommerce.com/community/contributions,1781/category,all/search,ship+cart)? I'd love to get these two working together and I'll start giving it a shot, but I'm still very much a beginner and am *hoping* some-one already done it :thumbsup:

 

Thanks,

~Barbara~

Link to comment
Share on other sites

  • Replies 257
  • Created
  • Last Reply

Top Posters In This Topic

bobsi, i dont use the contribution you mentioned but to get to know if you can use them together should be simple.

 

first, write down if and which files these contributions both need modified.

 

if there arent any - fine :)

 

if there are any, then you need to compare which areas of the files these do need changed.

 

if they modify the same area(s) you then need to find out if you can merge these two changes and so are able to apply them both at the same time.

Link to comment
Share on other sites

bobsi, i dont use the contribution you mentioned but to get to know if you can use them together should be simple.

 

first, write down if and which files these contributions both need modified.

 

if there arent any - fine :)

 

if there are any, then you need to compare which areas of the files these do need changed.

 

if they modify the same area(s) you then need to find out if you can merge these two changes and so are able to apply them both at the same time.

Thanks for your response but unfortunatly it isn't that simple :(

These two contributions have no files in common - it's something different that's causing the (potential) problems.

 

Ship in cart provides an estimate of shipping costs in the shopping cart - before the customer has started to checkout. The script uses a drop down list of countries to find out what country the customer is from in order to charge the right shipping. My problem is that list - It's a complete list of the countries - but I've used the Active Countries contribution to turn most of the countries 'off'. So I need it to show only the countries I have selected in admin. I'm still *hoping* some-ones already done it, otherwise I'm gunna have to dive in!

 

~barbara~

Link to comment
Share on other sites

Hi there... To begin with - a fantastic contribution, just what (I didn't know) I needed!!! THANKS!!!

 

What I'm wondering is - is anyone using it with 'Ship in Cart' (http://www.oscommerce.com/community/contributions,1781/category,all/search,ship+cart)? I'd love to get these two working together and I'll start giving it a shot, but I'm still very much a beginner and am *hoping* some-one already done it :thumbsup:

 

Thanks,

~Barbara~

 

Use the function tep_get_country_active_list instead of the tep_get_country_list in the shipping_estimator.php So the code will become

 

from this:

				  ENTRY_COUNTRY .' '. tep_get_country_list('country_id', $selected_country,'style="width=200"');

 

to this

 

				  ENTRY_COUNTRY .' '. tep_get_country_active_list('country_id', $selected_country,'style="width=200"');

 

at least that's the start but I am not sure about the states. If the contribution uses only the countries box that should be sufficient. If it uses a 2nd box like the states (seems it does that) you need to submit the form on country change so the page will refresh and show the correct list of states related to the selected country.

Link to comment
Share on other sites

Use the function tep_get_country_active_list instead of the tep_get_country_list in the shipping_estimator.php So the code will become

 

from this:

				  ENTRY_COUNTRY .' '. tep_get_country_list('country_id', $selected_country,'style="width=200"');

 

to this

 

				  ENTRY_COUNTRY .' '. tep_get_country_active_list('country_id', $selected_country,'style="width=200"');

 

at least that's the start but I am not sure about the states. If the contribution uses only the countries box that should be sufficient. If it uses a 2nd box like the states (seems it does that) you need to submit the form on country change so the page will refresh and show the correct list of states related to the selected country.

THANKS! I don't have time to try t out right now, but will give it a whirl tonight. Yes, it does use states, but I've actually turned them 'off', so you can't see them - so the customer just enters in their country and zip code (that's all I need for postage :))..

cheers,

~barbara~

Link to comment
Share on other sites

THANKS! I don't have time to try t out right now, but will give it a whirl tonight. Yes, it does use states, but I've actually turned them 'off', so you can't see them - so the customer just enters in their country and zip code (that's all I need for postage :))..

cheers,

~barbara~

Great, just tried it, works well, thanks again!

~barbara~

Link to comment
Share on other sites

  • 2 weeks later...

Starting with version 2.00 the module now supports control of multiple countries and active zones. Operation is extended to insert multiple zones within a tax zone with a single click. Separate mode of operation allows the user to select the way a country's states are inserted in the database. This latest addition allows the user to specify the countries and states of the store operation in a fast and efficient way. Zones multi-delete operations are also supported.

 

Version 2.00 was released with the following changes

 

- Added bug fixes for checkout_shipping_address.php and checkout_payment_address.php to address the shipping redirection issue. (by pnkranger)

- Now enforcing zones_id. Zones Name option no longer supported. Countries must have associated zones for the contribution to operate properly. See the Notes and Database Changes sections for more info.

- Added verification for country/state active status before form submission.

- Added multiple selection for zones & countries on the osC admin.

- Replaced default geo zones form with a multiple selection zone form. Can delete multiple zones with a single click from the osC admin.

- osC core bug fix to synchronize countries related tables when a country is removed.

- osC core bug fix to synchronize zones related tables when a zone is removed.

- Bug Fix to pre-select country when editing the customers address book.

- Updated package to include sql database of the world zones contribution mantaining compatibility sequence..

- Updated documentation.

 

Note: Even if you have a previous version of active countries installed you need to re-install the contribution as most of the old changes require updating.

Link to comment
Share on other sites

  • 2 weeks later...

enigma1, I hope your out there!

 

 

 

I seem to be having some difficulty with this great contribution. I am getting the following error in the admin/geo_zone.php page.

 

 

 

Fatal error: Call to undefined function: tep_get_active_countries() in /home/leakp/public_html/catalog/admin/geo_zones.php on line 148

 

 

 

The page is completely blank except for this error.

 

 

 

This is in the Locations/Taxes>Tax Zones section of admin. I did the recommended upload of the entire admin>geo_zones.php file that can in the contribution. The section of code the error refers to is:

 

 

 

case 'deleteconfirm_multizone':

$zID = tep_db_prepare_input($HTTP_GET_VARS['zID']);

foreach ($HTTP_POST_VARS['tax_zone_id'] as $tax_zone_id=>$val) {

tep_db_query("delete from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int)$zID . "' and association_id = '" . (int)$tax_zone_id . "'");

}

tep_redirect(tep_href_link(FILENAME_GEO_ZONES, 'zpage=' . $HTTP_GET_VARS['zpage'] . '&zID=' . $HTTP_GET_VARS['zID'] . '&action=list&spage=' . $HTTP_GET_VARS['spage']));

break;

 

}

}

 

$countries_array = tep_get_active_countries();

$modes_array = array(

array('id' => 'expand', 'text' => 'Expand To Zones'),

array('id' => 'all', 'text' => 'All Zones')

);

(Line 148 is in red)

 

 

 

As for the the sql files, I installed them and confirmed they are in the database. I went through the countries next and chose the countries I will be doing business with. I then checked the Zones area but found that the sql import missed adding a table, so I ran that section again. The table was created this time and I reviewed the zones in admin.

 

I then attempted to view the Tax Zones section to perform the step

 

5. Goto your osC Admin->Location/Taxes->Tax Zones. Create the zone folders to be used as the tax location folders. If you already have one or more select one of the existing folders.

 

, and that is where I got the error.

 

 

 

Any suggestions? Please help.

 

Rod

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

It's missing from the documentation ok at least it is present in the general.php file on the admin end. Item 12-a of the documentation should be:

 

a) Just before the last closing ?> add the following:

//-MS- Added active countries
////
// Sets the status of a country
 function tep_set_country_status($countries_id, $status) {
if ($status == '1') {
  return tep_db_query("update " . TABLE_COUNTRIES . " set countries_status = '1' where countries_id = '" . (int)$countries_id . "'");
} elseif ($status == '0') {
  return tep_db_query("update " . TABLE_COUNTRIES . " set countries_status = '0' where countries_id = '" . (int)$countries_id . "'");
} else {
  return -1;
}
 }

////
// Sets the status of a state
 function tep_set_zone_status($zone_id, $status) {
if ($status == '1') {
  return tep_db_query("update " . TABLE_ZONES . " set zone_status = '1' where zone_id = '" . (int)$zone_id . "'");
} elseif ($status == '0') {
  return tep_db_query("update " . TABLE_ZONES . " set zone_status = '0' where zone_id = '" . (int)$zone_id . "'");
} else {
  return -1;
}
 }
////
// Returns an array of active countries
 function tep_get_active_countries($countries_array = '') {

if (!is_array($countries_array)) 
  $countries_array = array();
//PHP 4.x Bug, not init as local var automatically with a global present?
$countries_query = '';
$countries_query = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " where countries_status = '1' order by countries_name");
while( $countries = tep_db_fetch_array($countries_query) ) {
  $countries_array[] = array('id' => $countries['countries_id'],
							 'text' => $countries['countries_name']);
}
return $countries_array;
 }
//-MS- Added active countries EOM

 

I will update the documentation with the next version.

Link to comment
Share on other sites

Thank-you very much my freind. That got me into the next portion of the install. So I followed the steps and set up USA as I ship will be shipping into the US.

 

 

 

I do however get a Parse Error when I attempt to edit an existing accounts addresses in

 

 

 

catalog/address_book_process.php/edit/16

 

 

 

when I click on edit I get this error:

 

 

 

Update Address Book Entrytable_background_address_book.gifpixel_trans.gif

Parse error: syntax error, unexpected '<' in /home/leakp/public_html/catalog/includes/modules/address_book_details.php on line 46

 

 

I can't seem to find it.

 

 

 

Here is my code for that page:

 

 

 

if (!isset($process)) $process = false;

?>

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

<tr>

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

<tr>

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

<td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></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" cellspacing="2" cellpadding="2">

<?php

if (ACCOUNT_GENDER == 'true') {

if (isset($gender)) {

$male = ($gender == 'm') ? true : false;

} else {

$male = ($entry['entry_gender'] == 'm') ? true : false;

}

$female = !$male;

?>

<?php // Res/Comm Contrib

 

if (isset($residence)) {

$residence = ($residence == 'Residential') ? true : false;

} else {

$residence = ($entry['ENTRY_RESIDENCE'] == 'Residential') ? true : false;

}

$commercial = !$residential; // Res/Comm Contrib

<tr>

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

<td class="main"><?php echo tep_draw_radio_field('gender', 'm', $male) . '  ' . MALE . '  ' . tep_draw_radio_field('gender', 'f', $female) . '  ' . FEMALE . ' ' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>

</tr>

<?php

}

?>

<tr>

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

<td class="main"><?php echo tep_draw_input_field('firstname', $entry['entry_firstname']) . ' ' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>

</tr>

<tr>

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

<td class="main"><?php echo tep_draw_input_field('lastname', $entry['entry_lastname']) . ' ' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>

</tr>

<tr>

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

</tr>

<?php

if (ACCOUNT_COMPANY == 'true') {

?>

<tr>

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

<td class="main"><?php echo tep_draw_input_field('company', $entry['entry_company']) . ' ' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>

</tr>

<!-- BOF Separate Pricing Per Customer -->

<?php

if (tep_not_null($entry['entry_company_tax_id'])) {

?>

<tr>

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

<td class="main"><?php echo $entry['entry_company_tax_id'] ; ?></td>

</tr>

<?php

} else { // end if (tep_not_null($entry['entry_company_tax_id']))

?> <tr>

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

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

</tr>

<?php

} // end else

?><!-- EOF Separate Pricing Per Customer -->

<tr>

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

</tr>

<?php

}

?>

<tr>

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

<td class="main"><?php echo tep_draw_input_field('street_address', $entry['entry_street_address']) . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>

</tr>

<?php

if (ACCOUNT_SUBURB == 'true') {

?>

<tr>

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

<td class="main"><?php echo tep_draw_input_field('suburb', $entry['entry_suburb']) . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>

</tr>

<?php

}

?>

<tr>

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

<td class="main"><?php echo tep_draw_input_field('postcode', $entry['entry_postcode']) . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>

</tr>

<tr>

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

<td class="main"><?php echo tep_draw_input_field('city', $entry['entry_city']) . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>

</tr>

<?php

if (ACCOUNT_STATE == 'true') {

?>

<tr>

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

<td class="main">

<?php

//-MS- Added Active Countries

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_id, zone_name from " . TABLE_ZONES . " where zone_status='1' and 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_id'], 'text' => $zones_values['zone_name']);

}

echo tep_draw_pull_down_menu('state', $zones_array, $entry['entry_zone_id']);

} else {

$zones_array = array();

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

$zones_query = tep_db_query("select zone_id, zone_name from " . TABLE_ZONES . " where zone_status='1' order by zone_name");

while ($zones_values = tep_db_fetch_array($zones_query)) {

$zones_array[] = array('id' => $zones_values['zone_id'], 'text' => $zones_values['zone_name']);

}

echo tep_draw_pull_down_menu('state', $zones_array, $entry['entry_zone_id']);

}

} else {

$zones_array = array();

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

$zones_query = tep_db_query("select zone_id, zone_name from " . TABLE_ZONES . " where zone_status='1' and 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_id'], 'text' => $zones_values['zone_name']);

}

echo tep_draw_pull_down_menu('state', $zones_array, $entry['entry_zone_id']);

}

//-MS- Added Active Countries

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"><b><?php echo ($tmp_object = tep_get_country_active_list('country', $country, 'onChange="this.form.submit();"')) . tep_draw_hidden_field('country_old', $country) . ' ' . (is_array($tmp_object) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></b></td>

</tr>

<?php // Res/comm Contrib

 

?>

<tr>

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

<td class="main"><?php echo tep_draw_radio_field('residence', 'Residential', $residential) . '  ' . RESIDENTIAL . '  ' . tep_draw_radio_field('residence', 'Commercial', $commercial) . '  ' . COMMERCIAL . ' ' . (tep_not_null(ENTRY_RESIDENCE_TEXT) ? '<span class="inputRequirement">' . ENTRY_RESIDENCE_TEXT . '</span>': ''); ?></td>

</tr>

<?php

if ((isset($HTTP_GET_VARS['edit']) && ($customer_default_address_id != $HTTP_GET_VARS['edit'])) || (isset($HTTP_GET_VARS['edit']) == false) ) {

?>

<tr>

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

</tr>

<tr>

<td colspan="2" class="main"><?php echo tep_draw_checkbox_field('primary', 'on', false, 'id="primary"') . ' ' . SET_AS_PRIMARY; ?></td>

</tr>

<?php

}

?>

</table></td>

</tr>

</table></td>

</tr>

</table>

 

 

 

Any idea's?

 

 

 

Thanks Again,

 

Rod

 

 

 

PS: The create account works great, thanks for fixing the drop down problem I was having!

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

Not sure where your line 46 exactly would be, but looks like you are missing closing PHP tag "?>" on

 

$commercial = !$residential; // Res/Comm Contrib

 

Make sure that your Res/Comm contrib is installed correctly.

 

:blink:

 

TIP: Try not to copy your PATH to files! Mask them with *** for your own good. :-" Some of us can get tempted.

 

 

I do however get a Parse Error when I attempt to edit an existing accounts addresses in

 

when I click on edit I get this error:

 

I can't seem to find it.

 

Here is my code for that page:

 

Any idea's?

 

 

 

Thanks Again,

 

Rod

 

 

 

PS: The create account works great, thanks for fixing the drop down problem I was having!

Edited by Dr_DK
Link to comment
Share on other sites

Not sure where your line 46 exactly would be, but looks like you are missing closing PHP tag "?>" on

 

$commercial = !$residential; // Res/Comm Contrib

 

Make sure that your Res/Comm contrib is installed correctly.

 

:blink:

 

TIP: Try not to copy your PATH to files! Mask them with *** for your own good. whistling.gif Some of us can get tempted.

 

 

 

And there it was, plain as day. (?>)

 

Thank-you, all working fine now.

 

 

 

I feel really dumb about not masking. I've done it on every other post. Maybe I should slep more?

 

Rod :blush:

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

  • 2 weeks later...
It's missing from the documentation ok at least it is present in the general.php file on the admin end. Item 12-a of the documentation should be:

 

a) Just before the last closing ?> add the following:

...

 

I will update the documentation with the next version.

 

I was having the same problem and that fixed it but now when I double click on a tax zone I get this error:

 

Fatal error: Call to undefined function: tep_get_geo_zone_name() in /[mypath]/admin/geo_zones.php on line 231

 

Have I missed something? thanx

 

(BTW - great contribution :thumbsup: )

Thanx,

Buesi

Link to comment
Share on other sites

This function tep_get_geo_zone_name is present with the default osc code. It is located in catalog\admin\includes\functions\general.php. Make sure you did not override that file with the general.php from the catalog end. If you did restore the file from your backups.

Link to comment
Share on other sites

Mark-

 

do you know if/how Active Countries works with the PayWithoutAccount contrib?

 

thanks,

rj

Yes it does but has to be integrated - along with every other contribution that includes some sort of countries/states filtering. I believe PWA should have a form similar to the create_account.php where you basically apply the same modifications.

Link to comment
Share on other sites

  • 3 weeks later...

there is a bug in the admin\geo_zones.php file. Locate this code

 

					<td class="smallText" align="right"><?php echo $countries_split->display_links($countries_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['mcpage'], 'mcpage=' . $HTTP_GET_VARS['mcpage'] . '&mcID=' . $HTTP_GET_VARS['mcID'] . '&action=multi_countries&zpage=' . $HTTP_GET_VARS['zpage'] . '&spage=' . $HTTP_GET_VARS['spage'], 'mcpage'); ?></td>

 

Replace it with this:

					<td class="smallText" align="right"><?php echo $countries_split->display_links($countries_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['mcpage'], 'mcID=' . $HTTP_GET_VARS['mcID'] . '&action=multi_countries&zpage=' . $HTTP_GET_VARS['zpage'] . '&spage=' . $HTTP_GET_VARS['spage'], 'mcpage'); ?></td>

 

The mcpage variable is already processed by the split page results. The side effect when listing the countries pages > 1 did not have an effect in the geo_zones script.

Link to comment
Share on other sites

Just installed Active Countries. New to database and not sure if I have set it up properly. I'm getting this error in my oscommerce control panel. How do I fix it?

 

Zones

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, 20

Link to comment
Share on other sites

Just installed Active Countries. New to database and not sure if I have set it up properly. I'm getting this error in my oscommerce control panel. How do I fix it?

 

Zones

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, 20

 

Yes it means you did not run the countries_custom.sql file that came with the contribution. Use phpmyadmin or whatever tool is provided by your host and run it.

Link to comment
Share on other sites

Yes it means you did not run the countries_custom.sql file that came with the contribution. Use phpmyadmin or whatever tool is provided by your host and run it.

I run countries_custom.sql and get :

 

Error

 

SQL-query :

 

ALTER TABLE `countries` ADD `countries_status` tinyint( 1 ) default '0' NOT NULL

 

MySQL said:

 

#1060 - Duplicate column name 'countries_status'

Link to comment
Share on other sites

I run countries_custom.sql and get :

 

Error

 

SQL-query :

 

ALTER TABLE `countries` ADD `countries_status` tinyint( 1 ) default '0' NOT NULL

 

MySQL said:

 

#1060 - Duplicate column name 'countries_status'

did you half-installed or you have an earlier version installed? If so you need to replace the changes from v1.00 with those of v2.00. As of the zones_status here is the query you need to run.

 

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

 

because seems you already have the countries_status.

Link to comment
Share on other sites

did you half-installed or you have an earlier version installed? If so you need to replace the changes from v1.00 with those of v2.00. As of the zones_status here is the query you need to run.

 

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

 

because seems you already have the countries_status.

 

Thanks alot ,that worked!

Link to comment
Share on other sites

  • 2 weeks later...

Anyone pls help, I got this error. In the admin when I select countries. The similar error also appear when I select zones, only the ...countries.php:3 changes to 1

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /catalog/admin/countries.php:3) in /catalog/admin/includes/functions/sessions.php on line 67

 

session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');

}

 

function tep_session_start() {

return session_start();

}

 

function tep_session_register($variable) {

return session_register($variable);

}

 

function tep_session_is_registered($variable) {

return session_is_registered($variable);

 

this is the the content in sessions.php, line 64 to 75. Anyone here who can highlight what is wrong? I don't know much about php and ended up in trouble.

Edited by hms
Link to comment
Share on other sites

Warning: main(includes/reset_meta_cache.php): failed to open stream: No such file or directory in /catalog/admin/countries.php on line 22

 

Warning: main(): Failed opening 'includes/reset_meta_cache.php' for inclusion (include_path='.:/usr/local/lib/php') in /catalog/admin/countries.php on line 22

 

Warning: main(includes/reset_seo_cache.php): failed to open stream: No such file or directory in /catalog/admin/countries.php on line 23

 

Warning: main(): Failed opening 'includes/reset_seo_cache.php' for inclusion (include_path='.:/usr/local/lib/php') in /catalog/admin/countries.php on line 23

 

Warning: Cannot modify header information - headers already sent by (output started at /catalog/admin/countries.php:22) in /catalog/admin/includes/functions/general.php on line 22

 

I had tried another method since the problem i encounter which i wrote in the earlier post.

 

This time, I copoid all the files in the contribution to use. The error i got here now is in the admin panel.

 

This come whenever I enable active countries. Although it display this error, somehow the selected country got active. Weird to me.

 

3 other problems i got is:

1.

i am unable to edit the country in the customer address section, i tried selecting other countries but it doesn't want to change

 

2.

need an option to delete the additional address of customers

 

3.

it doesn't want to proceed to payment info page....just stuck there

Link to comment
Share on other sites

I had tried another method since the problem i encounter which i wrote in the earlier post.

 

This time, I copoid all the files in the contribution to use. The error i got here now is in the admin panel.

 

This come whenever I enable active countries. Although it display this error, somehow the selected country got active. Weird to me.

 

3 other problems i got is:

1.

i am unable to edit the country in the customer address section, i tried selecting other countries but it doesn't want to change

 

2.

need an option to delete the additional address of customers

 

3.

it doesn't want to proceed to payment info page....just stuck there

 

The included files are for reference only. You should not use them and the readme states that. Anyways if you do not have a backup of the countries.php for the particular error you posted, open countries.php locate the following code

 

	// cDynamic Meta Tags 
// If the action will affect the cache entries
if ( eregi("(insert|update|setflag)", $action) ) {
  include_once('includes/reset_meta_cache.php');
  include_once('includes/reset_seo_cache.php');
}

and remove it.

 

Make sure you follow the manual instructions to update your files. The only files that should be copied directly are the "new files" in the readme and those explicitly specified by the manual instructions

 

and make sure you have this:

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

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

Edited by enigma1
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...