Post by ebtech » Wed Nov 14, 2007 9:50 am

How can I change the order of the address book entries? I need the postal code to appear after the city not before.

Actually I want it to go City, Region/State, Post Code, Country

I see the account_address.tpl file references these entries. Is this where to make the change? Will a change here affect other files like account_addresses.tpl and checkout_address.tpl?
Last edited by ebtech on Wed Nov 14, 2007 10:01 am, edited 1 time in total.

Newbie

Posts

Joined
Mon Nov 12, 2007 7:59 am

Post by tchemis » Wed Nov 14, 2007 10:04 am

Hello, this can be directly edited in the admin localization, please view this post for the solution http://forum.opencart.com/http://forum. ... 2723#p2723

Active Member

Posts

Joined
Tue Aug 21, 2007 9:23 am

Post by ebtech » Wed Nov 14, 2007 12:30 pm

Thank you again tchemis that was helpful. The address info is displaying correctly now.

However the input form has not changed. The format is still misplaced there. I would like it to be

firstname
lastname
company
address_1
address_2
city
region/state
postcode
country

It is awkward inputting the way it is.

Newbie

Posts

Joined
Mon Nov 12, 2007 7:59 am

Post by tchemis » Wed Nov 14, 2007 1:11 pm

Hello,

You will need to edit catalog\template\default\content\account_address.tpl

find:

Code: Select all

        <tr>
          <td><?php echo $entry_postcode; ?></td>
          <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" /></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_city; ?></td>
          <td><input type="text" name="city" value="<?php echo $city; ?>" />
            <?php if ($error_city) { ?>
            <span class="error"><?php echo $error_city; ?></span>
            <?php } ?>
          </td>
        </tr>
        <tr>
          <td><?php echo $entry_country; ?></td>
          <td><select name="country_id" onchange="$('#zone').load('index.php?controller=account_address&action=zone&country_id='+this.value+'&zone_id=<?php echo $zone_id; ?>');">
              <?php foreach ($countries as $country) { ?>
              <?php if ($country['country_id'] == $country_id) { ?>
              <option value="<?php echo $country['country_id']; ?>" SELECTED><?php echo $country['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
          </td>
        </tr>
        <tr>
          <td><?php echo $entry_zone; ?></td>
          <td id="zone"><select name="zone_id">
            </select></td>
        </tr>
And replace with:

Code: Select all

        <tr>
          <td><?php echo $entry_zone; ?></td>
          <td id="zone"><select name="zone_id">
            </select></td>
        </tr>
        <tr>
          <td><?php echo $entry_postcode; ?></td>
          <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" /></td>
        </tr>
        <tr>
          <td><?php echo $entry_country; ?></td>
          <td><select name="country_id" onchange="$('#zone').load('index.php?controller=account_address&action=zone&country_id='+this.value+'&zone_id=<?php echo $zone_id; ?>');">
              <?php foreach ($countries as $country) { ?>
              <?php if ($country['country_id'] == $country_id) { ?>
              <option value="<?php echo $country['country_id']; ?>" SELECTED><?php echo $country['name']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
              <?php } ?>
              <?php } ?>
            </select>
          </td>
        </tr>	
This will work, however it is now more weird, because they have to select their country name below, so that there provinces/states appear correctly my suggestion would be to just move the Postal Code/Zipcode only under the city name like so

Find:

Code: Select all

        <tr>
          <td><?php echo $entry_postcode; ?></td>
          <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" /></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_city; ?></td>
          <td><input type="text" name="city" value="<?php echo $city; ?>" />
            <?php if ($error_city) { ?>
            <span class="error"><?php echo $error_city; ?></span>
            <?php } ?>
          </td>
        </tr>
Replace with:

Code: Select all

        <tr>
          <td><span class="required">*</span> <?php echo $entry_city; ?></td>
          <td><input type="text" name="city" value="<?php echo $city; ?>" />
            <?php if ($error_city) { ?>
            <span class="error"><?php echo $error_city; ?></span>
            <?php } ?>
          </td>
        </tr>

        <tr>
          <td><?php echo $entry_postcode; ?></td>
          <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" /></td>
        </tr>
Hope this helps!

Active Member

Posts

Joined
Tue Aug 21, 2007 9:23 am

Post by ebtech » Thu Nov 15, 2007 11:05 am

I was able to change the order of the input, thx tchemis. I also made the post code a required field. I see now what you meant about the country being before the region so that the correct states/provinces etc show up in the drop down list. That still seems odd to me but I can't think of a way to change it without messing up the process unless the country came before the name or something.
Last edited by ebtech on Thu Nov 15, 2007 11:07 am, edited 1 time in total.

Newbie

Posts

Joined
Mon Nov 12, 2007 7:59 am

Post by KansasFiddler » Thu Nov 15, 2007 1:13 pm

I've seen where the autopopulated state dropdown sits to the right of the country dropdown.
You may need to edit, or remove entirely, some of the countries like "South Georgia and the South Sandwich Islands" in order for it to fit nicely when the sizes change.

Newbie

Posts

Joined
Thu Nov 15, 2007 1:11 am
Who is online

Users browsing this forum: No registered users and 4 guests