Page 1 of 1

ADmin : Customer Form -- Address, Zone default to none

Posted: Fri Aug 22, 2014 2:10 pm
by thegeekz
Hi,

As my registration form in the front end (Social Login or Normal) -- all defaults to None for the Zone as Singapore has no states.


admin/view/template/sale/customer_form.tpl


It just seems that when Customer registered with -- None -- as the zone by default, what the Customer form in the back end will show :

Zone : -- Please select --

rather than -- None --

Any way to change that?

The code in question is this :

Code: Select all

                <td><span class="required">*</span> <?php echo $entry_zone; ?></td>
 		<td><select name="address[<?php echo $address_row; ?>][zone_id]">
                  </select> 
                  <?php if (isset($error_address_zone[$address_row])) { ?>
                  <span class="error"><?php echo $error_address_zone[$address_row]; ?></span>
                  <?php } ?></td> 
I tried replacing

Code: Select all

<td><select name="address[<?php echo $address_row; ?>][zone_id]">
                  </select> 
With what is in the Store Settings :

Code: Select all

              <td><select name="config_zone_id">
                </select></td>
Didn't solve the issue -- instead shows a empty dropdown box.

Please help ...

Thank you.

Regards

Faustine

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Thu Aug 28, 2014 10:35 am
by thegeekz
Anyone can assist, please?

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Fri Aug 29, 2014 11:44 am
by thegeekz
anyone who is well versed in the backend admin -- coding... could help please?

I need to make Customer Form -- Zone field to auto to -- None --

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Tue Sep 02, 2014 3:25 pm
by thegeekz
Anyone?....

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Tue Sep 02, 2014 4:43 pm
by yuno
try
open opencart1564\admin\view\template\sale\customer_form.tpl

line 420

Code: Select all

    html += '      <td><select name="address[' + address_row + '][zone_id]"><option value="false"><?php echo $this->language->get('text_none'); ?></option></select></td>';
replace to

Code: Select all

    html += '      <td><select name="address[' + address_row + '][zone_id]"><option value="false"><?php echo $this->language->get('text_select'); ?></option></select></td>';

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Wed Sep 03, 2014 9:59 am
by thegeekz
Thanks Yuno for your reply.

Does this apply to OC1.5.6.1?

Code: Select all

<tr>
                <td><span class="required">*</span> <?php echo $entry_zone; ?></td>
 		<td><select name="address[<?php echo $address_row; ?>][zone_id]">
                  </select> 
                  <?php if (isset($error_address_zone[$address_row])) { ?>
                  <span class="error"><?php echo $error_address_zone[$address_row]; ?></span>
                  <?php } ?></td> 
</tr>
Its coded this way now in OC1.5.6.1....

Had to use this version as some of the customize extensions is not compatible with OC1.5.6.4.
yuno wrote: try
open opencart1564\admin\view\template\sale\customer_form.tpl

line 420

Code: Select all

    html += '      <td><select name="address[' + address_row + '][zone_id]"><option value="false"><?php echo $this->language->get('text_none'); ?></option></select></td>';
replace to

Code: Select all

    html += '      <td><select name="address[' + address_row + '][zone_id]"><option value="false"><?php echo $this->language->get('text_select'); ?></option></select></td>';

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Wed Sep 03, 2014 11:11 am
by thegeekz
Update:

Found this somewhere in the same file in my OC1.5.6.1 version:

Code: Select all

html += '    <tr>';
    html += '      <td><span class="required">*</span> <?php echo $entry_zone; ?></td>';
    html += '      <td><select name="address[' + address_row + '][zone_id]"><option value="false"><?php echo $this->language->get('text_none'); ?></option></select></td>';
    html += '    </tr>';

So I should just change the above to

Code: Select all

html += '    <tr>';
    html += '      <td><span class="required">*</span> <?php echo $entry_zone; ?></td>';
    html += '      <td><select name="address[' + address_row + '][zone_id]"><option value="false"><?php echo $this->language->get('text_select'); ?></option></select></td>';
    html += '    </tr>';
I suppose this should be the correct coding already! Trying them now...

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Wed Sep 03, 2014 11:32 am
by thegeekz
Done that but still not working.

See attached.

Still defaults to -- Please Select --
Image 5.jpg

Image 5.jpg (34.78 KiB) Viewed 2966 times




Edit: From Firebug, I see that the Dropdown box still has these as selection.
"" (which I guess will default to -- Please select -- )
"0" ( -- None -- )

Code: Select all

<select name="address[1][zone_id]">

    <option value=""></option>
    <option value="0">

         --- None ---

    </option>

I will need to get the -- None -- to show up as default for Singapore (which has no States).

In Account Register form in the front end, this is solved with the following codes :

Code: Select all

<div class="selectdiv">
            <select name="zone_id">
              
            </select>
</div>
Edit 2 --

Just saw in my Social Login , also in a section of my original Register form customz for Basico -- these same codings ---

Code: Select all

html = '<option value=""><?php echo $text_select; ?></option>';
      
      if (json['zone'] != '') {
        for (i = 0; i < json['zone'].length; i++) {
            html += '<option value="' + json['zone'][i]['zone_id'] + '"';
            html += '>' + json['zone'][i]['name'] + '</option>';
        }
      } else {
        html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
      }
SO I supposed it can be changed to :

Code: Select all

    
html += '    <tr>';
    html += '      <td><span class="required">*</span> <?php echo $entry_zone; ?></td>';
    html += '      <td><select name="address[' + address_row + '][zone_id]"><option value="0"><?php echo $this->language->get('text_none'); ?></option></select></td>';
    html += '    </tr>';
Trying it now...



Any more inputs?

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Wed Sep 03, 2014 12:12 pm
by yuno
As my registration form in the front end (Social Login or Normal) -- .......

It just seems that when Customer registered with -- None -- as the zone by default, what the Customer form in the back end will show :....

you are talking front end or back end?

sorry what's your expected result?

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Wed Sep 03, 2014 12:24 pm
by thegeekz
Tried all the above --- all didn't work....

Anymore inputs?

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Wed Sep 03, 2014 12:26 pm
by thegeekz
yuno wrote:As my registration form in the front end (Social Login or Normal) -- .......

It just seems that when Customer registered with -- None -- as the zone by default, what the Customer form in the back end will show :....

you are talking front end or back end?

sorry what's your expected result?
Front end is solved.

My problem now is Backend -- Customer form.

Just referencing how the problem was solved in the front end.. and trying it similarly.. but I still can't get the Zone to default to -- None --

Instead -- now its still showing -- Please Select -- then still need to select dropdown to indicate --None--

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Wed Sep 03, 2014 12:30 pm
by thegeekz
This is what it is now in the front end :
Image 6.jpg

Image 6.jpg (31.99 KiB) Viewed 2948 times

As long as the Country selected is Singapore (with no Zones defined) since no State in the country -- Zone goes automatically to -- None --

This is what I'm trying to achieve in the Customer form in the backend

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Mon Sep 08, 2014 10:56 am
by thegeekz
anyone?

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Fri Sep 12, 2014 1:08 pm
by thegeekz
Any one with further inputs?

I can't seem to solve this issue -- Zone : -- None -- rather than -- Please select --

Re: ADmin : Customer Form -- Address, Zone default to none

Posted: Mon Sep 15, 2014 1:46 pm
by thegeekz
Anyone?? No experts here could help?