F
F
filippokk2016-02-17 21:29:35
JavaScript
filippokk, 2016-02-17 21:29:35

How to automatically substitute region in opencart checkout?

In the opencart admin panel, I deleted all regions except one, how to make it automatically substituted in the drop-down list of regions, as I understand it, you need to change something in this code:

if (json['zone'] != '') {
        for (i = 0; i < json['zone'].length; i++) {
          html += '<option value="' + json['zone'][i]['zone_id'] + '"';
      
          if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {
            html += ' selected="selected"';
          }
      
          html += '>' + json['zone'][i]['name'] + '</option>';
        }
      } else {
        html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
      }
      
      $('#collapse-payment-address select[name=\'zone_id\']').html(html);
    },
    error: function(xhr, ajaxOptions, thrownError) {
      alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    }
  });
});

Please tell me what to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
slvn2, 2016-02-18
@slvn2

you are clearly not going to delete it there,
google "How to remove extra steps when placing an order", I had the same problem. There's a lot more to pick up

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question