tracking.twig (2458B)
1 {{ header }} 2 <div id="information-tracking" class="container"> 3 <ul class="breadcrumb"> 4 {% for breadcrumb in breadcrumbs %} 5 <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li> 6 {% endfor %} 7 </ul> 8 <div class="row">{{ column_left }} 9 {% if column_left and column_right %} 10 {% set class = 'col-sm-6' %} 11 {% elseif column_left or column_right %} 12 {% set class = 'col-sm-9' %} 13 {% else %} 14 {% set class = 'col-sm-12' %} 15 {% endif %} 16 <div id="content" class="{{ class }}">{{ content_top }} 17 <h1>{{ heading_title }}</h1> 18 <p>Please enter your shipping tracking No. below:</p> 19 20 <div class="form-group required"> 21 <label class="col-sm-2 control-label" for="input-code">{{ entry_code }} </label> 22 <div class="col-sm-10"> 23 <input type="text" name="code" value="{{ code }}" placeholder="{{ entry_code }}" id="input-code" class="form-control" /> 24 </div> 25 </div> 26 27 28 29 30 {{ content_bottom }}</div> 31 {{ column_right }}</div> 32 33 <script type="text/javascript"><!-- 34 $('#button-tracking').on('click', function() { 35 $.ajax({ 36 url: 'index.php?route=information/tracking/tracking&code=' + $('input[name="code"]').val(), 37 dataType: 'json', 38 beforeSend: function() { 39 $('#button-login').button('loading'); 40 }, 41 complete: function() { 42 $('#button-login').button('reset'); 43 }, 44 success: function(json) { 45 $('.alert-dismissible, .text-danger').remove(); 46 $('.form-group').removeClass('has-error'); 47 48 if (json['redirect']) { 49 location = json['redirect']; 50 } else if (json['error']) { 51 $('#collapse-checkout-option .panel-body').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error']['warning'] + '<button type="button" class="close" data-dismiss="alert">×</button></div>'); 52 53 // Highlight any found errors 54 $('input[name=\'email\']').parent().addClass('has-error'); 55 $('input[name=\'password\']').parent().addClass('has-error'); 56 } 57 }, 58 error: function(xhr, ajaxOptions, thrownError) { 59 alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); 60 } 61 }); 62 }); 63 64 </div> 65 {{ footer }}