Post by Lucmac » Mon Jul 15, 2019 6:44 pm

I would like to change the address format on the edit address page, so that the postcode is placed before the city. The code is currently:

Code: Select all

<div class="form-group required address-city">
            <label class="col-sm-2 control-label" for="input-city">{{ entry_city }}</label>
            <div class="col-sm-10">
              <input type="text" name="city" value="{{ city }}" placeholder="{{ entry_city }}" id="input-city" class="form-control" />
              {% if error_city %}
              <div class="text-danger">{{ error_city }}</div>
              {% endif %} </div>
          </div>
          <div class="form-group required address-postcode">
            <label class="col-sm-2 control-label" for="input-postcode">{{ entry_postcode }}</label>
            <div class="col-sm-10">
              <input type="text" name="postcode" value="{{ postcode }}" placeholder="{{ entry_postcode }}" id="input-postcode" class="form-control" />
              {% if error_postcode %}
              <div class="text-danger">{{ error_postcode }}</div>
              {% endif %} </div>
          </div>
is there a way via xml (ocmod) to switch the position of these divs, because from what I understand it's not possible to change the sort order of the divs via the admin panel? Thanks for any help!

Newbie

Posts

Joined
Mon Apr 22, 2019 5:29 pm

Post by xxvirusxx » Mon Jul 15, 2019 6:59 pm

Why don't directly edit the file and change?

My Extensions | OC 3.0.3.1, 3.0.2.0, 2.3.0.2 with bugs fixed | 2.3.0.2 Custom version | Buy me a beer or coffee


Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm

Post by Lucmac » Mon Jul 15, 2019 8:29 pm

it's generally not good practice to edit core files

Newbie

Posts

Joined
Mon Apr 22, 2019 5:29 pm

Post by letxobnav » Mon Jul 15, 2019 8:35 pm

using ocmod and the like is fine if you want to easily install and de-install functionality.
if you are using them in the expectation that they will enable future worry-free OC upgrades, you better think again.

Crystal Light Centrum Taiwan
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Lucmac » Mon Jul 15, 2019 8:41 pm

thanks for the reply, which did make me have a 2nd thought, so for now I've gone with the following:

Code: Select all

$( document ).ready(function() {
	$(".address-postcode").insertBefore($(".address-city"));
});

Newbie

Posts

Joined
Mon Apr 22, 2019 5:29 pm

Post by xxvirusxx » Mon Jul 15, 2019 10:39 pm

Lucmac wrote:
Mon Jul 15, 2019 8:29 pm
it's generally not good practice to edit core files
Then use ocmod using offset, index

My Extensions | OC 3.0.3.1, 3.0.2.0, 2.3.0.2 with bugs fixed | 2.3.0.2 Custom version | Buy me a beer or coffee


Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Who is online

Users browsing this forum: No registered users and 9 guests