Post by brussell » Wed Dec 21, 2016 2:13 am

Hi,

Version: OC 2.2.0

The state/region dropdowns under the Payment and Shipping Address areas have been preselected with the state/region that has been defined under Settings > Local.

The problem with this is that some customers are forgetting to select their region/state and so an order will come through showing the wrong region/state.

Is there a way to change this so that the 'Please Select' option is default? This way, it will force the customer to select their state/region.

Thanks to anyone who can help with this

Brett

New member

Posts

Joined
Thu Jan 31, 2013 12:51 am

Post by IP_CAM » Wed Dec 21, 2016 11:30 am

I am not really sure about your wishes, but check the image, for a possible fix.
It's untested, I don't know, how your Customers are exactly able to check out...
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by brussell » Wed Dec 21, 2016 11:15 pm

Thanks for helping guys. That solved the issue @IP_CAM, thank you :)

New member

Posts

Joined
Thu Jan 31, 2013 12:51 am

Post by websiteworld » Mon Jan 30, 2017 8:31 am

For Opencart 2.3 comment out lines 324-326 of shipping_address.tpl

Code: Select all

//					if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
//						html += ' selected="selected"';
//					}

User avatar
New member

Posts

Joined
Thu Oct 18, 2012 3:11 am

Post by stavrosa » Wed May 08, 2019 5:16 pm

Thanks @IP_CAM

For Journal2 same lines on
catalog/view/theme/journal2/template/journal2/checkout/address_form.tpl

Newbie

Posts

Joined
Wed Sep 23, 2015 8:08 pm

Post by stavrosa » Thu Jun 06, 2019 8:15 pm

Do we have an update on this for OC3?

catalog/view/theme/journal3/template/journal3/checkout/address.twig
the twig code for journal3 goes like this:

Code: Select all

 
      <div class="form-group required address-zone">
        <label class="control-label" for="input-{{ type }}-zone">{{ entry_zone }}</label>
        <select v-model="order_data.{{ type }}_zone_id" v-on:change="save()" name="zone_id" id="input-{{ type }}-zone" class="form-control">
          <option v-if="{{ type }}_zones.length > 0" value="">{{ text_select }}</option>
          <option v-if="{{ type }}_zones.length == 0" value="">{{ text_none }}</option>
          <option v-for="zone in {{ type }}_zones" v-bind:value="zone.zone_id" v-html="zone.name"></option>
        </select>
        <span class="text-danger" v-if="error && error.{{ type }}_zone" v-html="error.{{ type }}_zone"></span>
       </div>
EDIT:
Solution: Just comment the last option, seems to be working fine (same on country too)

Code: Select all

<!--option v-for="zone in {{ type }}_zones" v-bind:value="zone.zone_id" v-html="zone.name"></option-->

Newbie

Posts

Joined
Wed Sep 23, 2015 8:08 pm

Post by Zanato » Sun Dec 01, 2019 9:12 pm

stavrosa wrote:
Thu Jun 06, 2019 8:15 pm
Do we have an update on this for OC3?

Solution: Just comment the last option....
There is a much easier solution...

Go to Admin > System > Settings > Edit your Store > Local Tab...

and just leave Region / State on "---Please Select---".

No need to edit core files. This is tested on OC3. Not sure if it works for older versions but seeing as this thread features high on Google for searching this problem, I'll post it here.

New member

Posts

Joined
Fri Oct 04, 2013 4:58 am
Location - Dublin, Ireland
Who is online

Users browsing this forum: No registered users and 75 guests