states/regions not loading at checkout for guests or registration in opencart -


im having opencart 1.5.4 installed... there problem users/guests unable register @ checkout because states not being populated based on country...

when user registers @ register page works not @ checkout..

below js think populates states in checkout/register.tpl..

<script type="text/javascript"><!-- $('#payment-address select[name=\'country_id\']').bind('change', function() {     $.ajax({         url: 'index.php?route=checkout/checkout/country&country_id=' + this.value,         datatype: 'json',         beforesend: function() {             $('#payment-address select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="catalog/view/theme/default/image/loading.gif" alt="" /></span>');         },         complete: function() {             $('.wait').remove();         },                   success: function(json) {             if (json['postcode_required'] == '1') {                 $('#payment-postcode-required').show();             } else {                 $('#payment-postcode-required').hide();             }              html = '<option value=""><?php echo $text_select; ?></option>';              if (json['zone'] != '') {                  (i = 0; < 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>';             }              $('#payment-address select[name=\'zone_id\']').html(html);         },         error: function(xhr, ajaxoptions, thrownerror) {             alert(thrownerror + "\r\n" + xhr.statustext + "\r\n" + xhr.responsetext);         }     }); });  $('#payment-address select[name=\'country_id\']').trigger('change'); //--></script>  

when check in firebug code doesnt run @ all... nothing happens.. atleast doesnt show me error.

the similar code @ registration page works without problem.

you can have @ cart website http://tinyurl.com/oup3hsv

any appreciated

you need update files in checkout folder.

first of all, download default opencart 1.5.4 source official opencart site.

copy files default source
go default opepncart source catalog\view\theme\default\template\checkout\ copy following files.

  • guest.tpl
  • guest_shipping.tpl
  • payment_address.tpl
  • payment_method.tpl
  • shipping_address.tpl
  • shipping_method.tpl

replace files in site source
go site source catalog\view\theme\default\template\checkout\ replace above files.

& check it.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -