Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

city, state, zip...NOT city, zip, state


RelentlessSkateshop

Recommended Posts

Ladies and Gentlemen,

 

A store I shopped at was using OsCommerce, and I made a mistake when I filled out the account information. The usual process people in America use to fill out an address is to enter the city, state and then zip code. This is not the way the form is set up for opening a new account in OsC. I thought I'd be daring and try to put the postal code entry field after the state's entry field by cutting and pasting the code in catalog/create_account.php

 

After doing that, the error text shows up with the red asterisks right when you open the page...it doesn't even wait to give you the red error text after you enter something.

 

See Here : http://www.relentlessskateshop.com/skateboards/

 

Can someone tell me what else I need to change to get this modification to work?

 

Thanks in advance,

Jeffrey

Here, have some code:

<?php
 if (ACCOUNT_STATE == 'true') {
?>
		  <tr>
			<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_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>
		  </tr><tr>
			<td class="main"><?php echo ENTRY_POST_CODE; ?></td>
			<td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>

If you say you can't do it, you're only fooling yourself.

Link to comment
Share on other sites

Ladies and Gentlemen,

 

A store I shopped at was using OsCommerce, and I made a mistake when I filled out the account information. The usual process people in America use to fill out an address is to enter the city, state and then zip code. This is not the way the form is set up for opening a new account in OsC. I thought I'd be daring and try to put the postal code entry field after the state's entry field by cutting and pasting the code in catalog/create_account.php

 

After doing that, the error text shows up with the red asterisks right when you open the page...it doesn't even wait to give you the red error text after you enter something.

 

See Here : http://www.relentlessskateshop.com/skateboards/

 

Can someone tell me what else I need to change to get this modification to work?

 

Thanks in advance,

Jeffrey

Here, have some code:

<?php
 if (ACCOUNT_STATE == 'true') {
?>
		  <tr>
			<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_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>
		  </tr><tr>
			<td class="main"><?php echo ENTRY_POST_CODE; ?></td>
			<td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>

 

\

You got busy messing around in the wrong part of creat_account.php, you're up in the logic section. Restore all that stuff so that it works right. Then, go wander around down the bottom someplace and you'll come across

 

<tr>

<td>post code something or other it'll be evident when you see it.

</td>

</tr>

 

Grab the text from Table record <tr> to not table record </tr>

go stick it right after end php ?>

 

Right before country.

 

Make sure you get all four rows. It'll work just fine.

 

did you change the name of Psot code to Zip code in languages/english.php?

 

Mike

Link to comment
Share on other sites

B)-->

QUOTE(Michael B @ Jan 8 2007, 08:25 PM) <{POST_SNAPBACK}>

\

You got busy messing around in the wrong part of creat_account.php, you're up in the logic section. Restore all that stuff so that it works right. Then, go wander around down the bottom someplace and you'll come across

 

<tr>

<td>post code something or other it'll be evident when you see it.

</td>

</tr>

 

Grab the text from Table record <tr> to not table record </tr>

go stick it right after end php ?>

 

Right before country.

 

Make sure you get all four rows. It'll work just fine.

 

did you change the name of Psot code to Zip code in languages/english.php?

 

Mike

 

I've got four of these things-

 

You can do it so it looks like this, it'll work.

 

M

 

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

</tr>

<tr>

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

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

</tr>

<?php

}

?>

<tr>

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

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

</tr>

</table></td>

Link to comment
Share on other sites

  <tr>
			<td class="main">Postal Zip Code:</td>
			<td class="main"><input type="text" name="postcode"> <span class="inputRequirement">*</span></td>
		  </tr>
		  <tr>

			<td class="main">City:</td>
			<td class="main"><input type="text" name="city"> <span class="inputRequirement">*</span></td>
		  </tr>
		  <tr>
			<td class="main">State/Province:</td>
			<td class="main">
<input type="text" name="state"> <span class="inputRequirement">*				</td>

		  </tr>

 

That's how it's showing after the page loads...I still get the red error text...hmm, Thanks for the quick reply, though! I file compared it with the original Oscommerce catalog install to make sure it was the same. The file's been changed with the CCGV contribution and the contribution that automatically checks the newsletter box. I'm afraid to proceed with any more changes until I get the errors to stop. Any ideas on where to start the troubleshooting?

 

Thanks again,

Jeffrey

If you say you can't do it, you're only fooling yourself.

Link to comment
Share on other sites

  <tr>
			<td class="main">Postal Zip Code:</td>
			<td class="main"><input type="text" name="postcode"> <span class="inputRequirement">*</span></td>
		  </tr>
		  <tr>

			<td class="main">City:</td>
			<td class="main"><input type="text" name="city"> <span class="inputRequirement">*</span></td>
		  </tr>
		  <tr>
			<td class="main">State/Province:</td>
			<td class="main">
<input type="text" name="state"> <span class="inputRequirement">*				</td>

		  </tr>

 

That's how it's showing after the page loads...I still get the red error text...hmm, Thanks for the quick reply, though! I file compared it with the original Oscommerce catalog install to make sure it was the same. The file's been changed with the CCGV contribution and the contribution that automatically checks the newsletter box. I'm afraid to proceed with any more changes until I get the errors to stop. Any ideas on where to start the troubleshooting?

 

Thanks again,

Jeffrey

Hi Jeffrey-

 

I'm not actually certain it's an error condition. I think it's just letting people know they are required fields. If you can wait, I can have a look tomorrow night. I have to be up at 4 AM to drive to LA for an early morning meeting. Happy to whack at it tomorrow evening if you like.

 

Mike

Link to comment
Share on other sites

Whoa, wait! Am I supposed to get the red asterisks <span class=input requirement> regardless if I open the page before or after I enter the info, or is it given only if the server thinks it's not filled out correctly?

If you say you can't do it, you're only fooling yourself.

Link to comment
Share on other sites

Ok, Mike, it looks like I was on the right track. I cut and pasted the text areas and their entry fields respectively, just as you suggested. If you look closely, our posts are virtually identical. I was worried about this change I made because a customer made an account a few days ago, and in the admin, there is no date showing when they opened the account, last modified, last logon..all those fields are blank. If I click on the customer's name and try to edit their info, I get a big fat error message at the top and all the fields for the customer are empty. BUT, if I go rooting around in my database, it's showing I have this customer's address, state, zip, all the info! I've put the error message through the search engines and I haven't seen anything new that I haven't already tried.

Warning: reset(): Passed variable is not an array or object in catalog/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in catalog/admin/includes/classes/object_info.php on line 18

 

I did a google search on these errors, and there are A LOT of people that are having the same problem out there. I tried a small change in catalog/includes/functions/database.php and it didn't make a difference:

function tep_db_insert_id( $link = 'db_link') {
global $$link;
return mysql_insert_id($$link);
}

 

Again, it seems as though this problem has affected a number of people.

If you say you can't do it, you're only fooling yourself.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...