Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Issue displaying Added address fields to contact_us

Issue displaying Added address fields to contact_us

Locked

Views: 1,601

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
21 May 2008, 8:48 AM
#1
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Issue displaying Added address fields to contact_us

I have added some fields to the tpl_contact_us_default.php file from the modules/create_account.php file.

Most of this displays as expected with the exception of the text description "State/Province:" and the view source indicates that "ENTRY_STATE" is there BUT no text is rendered.

So I have obviously missed something but can not determine what?

This is the code added to tpl_contact_us_default.php and I have highlighted the state echo statement

<?php
  if (ACCOUNT_STATE == 'true') {
    if ($flag_show_pulldown_states == true) {
?>
<label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>
<?php
      echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'id="stateZone"');
      if (zen_not_null(ENTRY_STATE_TEXT)) echo ' <span class="alert">' . ENTRY_STATE_TEXT . '</span>'; 
    }
?>

<?php if ($flag_show_pulldown_states == true) { ?>
<br class="clearBoth" id="stBreak" />
<?php } ?>
<label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label; ?></label>
<?php
    echo zen_draw_input_field('state', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"');
    if (zen_not_null(ENTRY_STATE_TEXT)) echo ' <span class="alert" id="stText">' . ENTRY_STATE_TEXT . '</span>';
    if ($flag_show_pulldown_states == false) {
      echo zen_draw_hidden_field('zone_id', $zone_name, ' ');
    }
?>
<br class="clearBoth" />

The source for city and then state is as follows and I can see that it is not correct but no idea why/ what I missed

<label class="inputLabel" for="city">City:</label>
<label class="inputLabel" for="state" id="stateLabel"></label>

One can see the display or view the source HERE
It should be right below the City text.

Thanks for looking and any ideas as to what I missed

21 May 2008, 8:58 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Issue displaying Added address fields to contact_us

If you're trying to add city/state/zip/country information to other pages, you'll probably need the jscript_xxxx files copied to that page as well. Look at the includes/modules/pages folder for the page you copied concepts from, and copy the javascript file related to address pulldowns. That may get you a step closer.

21 May 2008, 9:44 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Issue displaying Added address fields to contact_us

Thanks DrByte,

I was not enabling the pull down but did copy the .js files to the create account page dir

I also merged the header_php.php and added the require and the include that were not present but this also showed no joy

The create account source has this for city & state

<label class="inputLabel" for="city">City:</label>
<label class="inputLabel" for="state" id="stateLabel">State/Province:</label>

And the altered contact us still does not have the state text in the source

<label class="inputLabel" for="city">City:</label>
<label class="inputLabel" for="state" id="stateLabel"></label>