shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

order_info.twig (25022B)


      1 {{ header }}{{ column_left }}
      2 <div id="content">
      3   <div class="page-header">
      4     <div class="container-fluid">
      5       <div class="pull-right"><a href="{{ invoice }}" target="_blank" data-toggle="tooltip" title="{{ button_invoice_print }}" class="btn btn-info"><i class="fa fa-print"></i></a> <a href="{{ shipping }}" target="_blank" data-toggle="tooltip" title="{{ button_shipping_print }}" class="btn btn-info"><i class="fa fa-truck"></i></a> <a href="{{ edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a> <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
      6       <h1>{{ heading_title }}</h1>
      7       <ul class="breadcrumb">
      8         {% for breadcrumb in breadcrumbs %}
      9         <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
     10         {% endfor %}
     11       </ul>
     12     </div>
     13   </div>
     14   <div class="container-fluid">
     15     <div class="row">
     16       <div class="col-md-4">
     17         <div class="panel panel-default">
     18           <div class="panel-heading">
     19             <h3 class="panel-title"><i class="fa fa-shopping-cart"></i> {{ text_order_detail }}</h3>
     20           </div>
     21           <table class="table">
     22             <tbody>
     23               <tr>
     24                 <td style="width: 1%;"><button data-toggle="tooltip" title="{{ text_store }}" class="btn btn-info btn-xs"><i class="fa fa-shopping-cart fa-fw"></i></button></td>
     25                 <td><a href="{{ store_url }}" target="_blank">{{ store_name }}</a></td>
     26               </tr>
     27               <tr>
     28                 <td><button data-toggle="tooltip" title="{{ text_date_added }}" class="btn btn-info btn-xs"><i class="fa fa-calendar fa-fw"></i></button></td>
     29                 <td>{{ date_added }}</td>
     30               </tr>
     31               <tr>
     32                 <td><button data-toggle="tooltip" title="{{ text_payment_method }}" class="btn btn-info btn-xs"><i class="fa fa-credit-card fa-fw"></i></button></td>
     33                 <td>{{ payment_method }}</td>
     34               </tr>
     35             {% if shipping_method %}
     36             <tr>
     37               <td><button data-toggle="tooltip" title="{{ text_shipping_method }}" class="btn btn-info btn-xs"><i class="fa fa-truck fa-fw"></i></button></td>
     38               <td>{{ shipping_method }}</td>
     39             </tr>
     40             {% endif %}
     41               </tbody>
     42             
     43           </table>
     44         </div>
     45       </div>
     46       <div class="col-md-4">
     47         <div class="panel panel-default">
     48           <div class="panel-heading">
     49             <h3 class="panel-title"><i class="fa fa-user"></i> {{ text_customer_detail }}</h3>
     50           </div>
     51           <table class="table">
     52             <tr>
     53               <td style="width: 1%;"><button data-toggle="tooltip" title="{{ text_customer }}" class="btn btn-info btn-xs"><i class="fa fa-user fa-fw"></i></button></td>
     54               <td>{% if customer %} <a href="{{ customer }}" target="_blank">{{ firstname }} {{ lastname }}</a> {% else %}
     55                 {{ firstname }} {{ lastname }}
     56                 {% endif %}</td>
     57             </tr>
     58             <tr>
     59               <td><button data-toggle="tooltip" title="{{ text_customer_group }}" class="btn btn-info btn-xs"><i class="fa fa-group fa-fw"></i></button></td>
     60               <td>{{ customer_group }}</td>
     61             </tr>
     62             <tr>
     63               <td><button data-toggle="tooltip" title="{{ text_email }}" class="btn btn-info btn-xs"><i class="fa fa-envelope-o fa-fw"></i></button></td>
     64               <td><a href="mailto:{{ email }}">{{ email }}</a></td>
     65             </tr>
     66             <tr>
     67               <td><button data-toggle="tooltip" title="{{ text_telephone }}" class="btn btn-info btn-xs"><i class="fa fa-phone fa-fw"></i></button></td>
     68               <td>{{ telephone }}</td>
     69             </tr>
     70           </table>
     71         </div>
     72       </div>
     73       <div class="col-md-4">
     74         <div class="panel panel-default">
     75           <div class="panel-heading">
     76             <h3 class="panel-title"><i class="fa fa-cog"></i> {{ text_option }}</h3>
     77           </div>
     78           <table class="table">
     79             <tbody>
     80               <tr>
     81                 <td>{{ text_invoice }}</td>
     82                 <td id="invoice" class="text-right">{{ invoice_no }}</td>
     83                 <td style="width: 1%;" class="text-center">{% if not invoice_no %}
     84                   <button id="button-invoice" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_generate }}" class="btn btn-success btn-xs"><i class="fa fa-cog"></i></button>
     85                   {% else %}
     86                   <button disabled="disabled" class="btn btn-success btn-xs"><i class="fa fa-refresh"></i></button>
     87                   {% endif %}</td>
     88               </tr>
     89               <tr>
     90                 <td>{{ text_reward }}</td>
     91                 <td class="text-right">{{ reward }}</td>
     92                 <td class="text-center">{% if customer and reward %}
     93                   {% if not reward_total %}
     94                   <button id="button-reward-add" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_reward_add }}" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>
     95                   {% else %}
     96                   <button id="button-reward-remove" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_reward_remove }}" class="btn btn-danger btn-xs"><i class="fa fa-minus-circle"></i></button>
     97                   {% endif %}
     98                   {% else %}
     99                   <button disabled="disabled" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>
    100                   {% endif %}</td>
    101               </tr>
    102               <tr>
    103                 <td>{{ text_affiliate }}
    104                   {% if affiliate %}
    105                   (<a href="{{ affiliate }}">{{ affiliate_firstname }} {{ affiliate_lastname }}</a>)
    106                   {% endif %}</td>
    107                 <td class="text-right">{{ commission }}</td>
    108                 <td class="text-center">{% if affiliate %}
    109                   {% if not commission_total %}
    110                   <button id="button-commission-add" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_commission_add }}" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>
    111                   {% else %}
    112                   <button id="button-commission-remove" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_commission_remove }}" class="btn btn-danger btn-xs"><i class="fa fa-minus-circle"></i></button>
    113                   {% endif %}
    114                   {% else %}
    115                   <button disabled="disabled" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>
    116                   {% endif %}</td>
    117               </tr>
    118             </tbody>
    119           </table>
    120         </div>
    121       </div>
    122     </div>
    123     <div class="panel panel-default">
    124       <div class="panel-heading">
    125         <h3 class="panel-title"><i class="fa fa-info-circle"></i> {{ text_order }}</h3>
    126       </div>
    127       <div class="panel-body">
    128         <table class="table table-bordered">
    129           <thead>
    130             <tr>
    131               <td style="width: 50%;" class="text-left">{{ text_payment_address }}</td>
    132               {% if shipping_method %}
    133               <td style="width: 50%;" class="text-left">{{ text_shipping_address }}</td>
    134               {% endif %} </tr>
    135           </thead>
    136           <tbody>
    137             <tr>
    138               <td class="text-left">{{ payment_address }}</td>
    139               {% if shipping_method %}
    140               <td class="text-left">{{ shipping_address }}</td>
    141               {% endif %} </tr>
    142           </tbody>
    143         </table>
    144         <table class="table table-bordered">
    145           <thead>
    146             <tr>
    147               <td class="text-left">{{ column_product }}</td>
    148               <td class="text-left">{{ column_model }}</td>
    149               <td class="text-right">{{ column_quantity }}</td>
    150               <td class="text-right">{{ column_price }}</td>
    151               <td class="text-right">{{ column_total }}</td>
    152             </tr>
    153           </thead>
    154           <tbody>
    155           
    156           {% for product in products %}
    157           <tr>
    158             <td class="text-left"><a href="{{ product.href }}">{{ product.name }}</a> {% for option in product.option %} <br />
    159               {% if option.type != 'file' %}
    160               &nbsp;<small> - {{ option.name }}: {{ option.value }}</small> {% else %}
    161               &nbsp;<small> - {{ option.name }}: <a href="{{ option.href }}">{{ option.value }}</a></small> {% endif %}
    162               {% endfor %}</td>
    163             <td class="text-left">{{ product.model }}</td>
    164             <td class="text-right">{{ product.quantity }}</td>
    165             <td class="text-right">{{ product.price }}</td>
    166             <td class="text-right">{{ product.total }}</td>
    167           </tr>
    168           {% endfor %}
    169           {% for voucher in vouchers %}
    170           <tr>
    171             <td class="text-left"><a href="{{ voucher.href }}">{{ voucher.description }}</a></td>
    172             <td class="text-left"></td>
    173             <td class="text-right">1</td>
    174             <td class="text-right">{{ voucher.amount }}</td>
    175             <td class="text-right">{{ voucher.amount }}</td>
    176           </tr>
    177           {% endfor %}
    178           {% for total in totals %}
    179           <tr>
    180             <td colspan="4" class="text-right">{{ total.title }}</td>
    181             <td class="text-right">{{ total.text }}</td>
    182           </tr>
    183           {% endfor %}
    184             </tbody>
    185           
    186         </table>
    187         {% if comment %}
    188         <table class="table table-bordered">
    189           <thead>
    190             <tr>
    191               <td>{{ text_comment }}</td>
    192             </tr>
    193           </thead>
    194           <tbody>
    195             <tr>
    196               <td>{{ comment }}</td>
    197             </tr>
    198           </tbody>
    199         </table>
    200         {% endif %} </div>
    201     </div>
    202     <div class="panel panel-default">
    203       <div class="panel-heading">
    204         <h3 class="panel-title"><i class="fa fa-comment-o"></i> {{ text_history }}</h3>
    205       </div>
    206       <div class="panel-body">
    207         <ul class="nav nav-tabs">
    208           <li class="active"><a href="#tab-history" data-toggle="tab">{{ tab_history }}</a></li>
    209           <li><a href="#tab-additional" data-toggle="tab">{{ tab_additional }}</a></li>
    210           {% for tab in tabs %}
    211           <li><a href="#tab-{{ tab.code }}" data-toggle="tab">{{ tab.title }}</a></li>
    212           {% endfor %}
    213         </ul>
    214         <div class="tab-content">
    215           <div class="tab-pane active" id="tab-history">
    216             <div id="history"></div>
    217             <br />
    218             <fieldset>
    219               <legend>{{ text_history_add }}</legend>
    220               <form class="form-horizontal">
    221                 <div class="form-group">
    222                   <label class="col-sm-2 control-label" for="input-order-status">{{ entry_order_status }}</label>
    223                   <div class="col-sm-10">
    224                     <select name="order_status_id" id="input-order-status" class="form-control">
    225                       
    226                       
    227                       {% for order_statuses in order_statuses %}
    228                       {% if order_statuses.order_status_id == order_status_id %}
    229                       
    230                       
    231                       <option value="{{ order_statuses.order_status_id }}" selected="selected">{{ order_statuses.name }}</option>
    232                       
    233                       
    234                       {% else %}
    235                       
    236                       
    237                       <option value="{{ order_statuses.order_status_id }}">{{ order_statuses.name }}</option>
    238                       
    239                       
    240                       {% endif %}
    241                       {% endfor %}
    242                     
    243                     
    244                     </select>
    245                   </div>
    246                 </div>
    247                 <div class="form-group">
    248                   <label class="col-sm-2 control-label" for="input-override"><span data-toggle="tooltip" title="{{ help_override }}">{{ entry_override }}</span></label>
    249                   <div class="col-sm-10">
    250                     <div class="checkbox">
    251                       <input type="checkbox" name="override" value="1" id="input-override" />
    252                     </div>
    253                   </div>
    254                 </div>
    255                 <div class="form-group">
    256                   <label class="col-sm-2 control-label" for="input-notify">{{ entry_notify }}</label>
    257                   <div class="col-sm-10">
    258                     <div class="checkbox">
    259                       <input type="checkbox" name="notify" value="1" id="input-notify" />
    260                     </div>
    261                   </div>
    262                 </div>
    263                 <div class="form-group">
    264                   <label class="col-sm-2 control-label" for="input-comment">{{ entry_comment }}</label>
    265                   <div class="col-sm-10">
    266                     <textarea name="comment" rows="8" id="input-comment" class="form-control"></textarea>
    267                   </div>
    268                 </div>
    269               </form>
    270             </fieldset>
    271             <div class="text-right">
    272               <button id="button-history" data-loading-text="{{ text_loading }}" class="btn btn-primary"><i class="fa fa-plus-circle"></i> {{ button_history_add }}</button>
    273             </div>
    274           </div>
    275           <div class="tab-pane" id="tab-additional"> {% if account_custom_fields %}
    276             <div class="table-responsive">
    277               <table class="table table-bordered">
    278                 <thead>
    279                   <tr>
    280                     <td colspan="2">{{ text_account_custom_field }}</td>
    281                   </tr>
    282                 </thead>
    283                 <tbody>
    284                 
    285                 {% for custom_field in account_custom_fields %}
    286                 <tr>
    287                   <td>{{ custom_field.name }}</td>
    288                   <td>{{ custom_field.value }}</td>
    289                 </tr>
    290                 {% endfor %}
    291                   </tbody>
    292                 
    293               </table>
    294             </div>
    295             {% endif %}
    296             {% if payment_custom_fields %}
    297             <div class="table-responsive">
    298               <table class="table table-bordered">
    299                 <thead>
    300                   <tr>
    301                     <td colspan="2">{{ text_payment_custom_field }}</td>
    302                   </tr>
    303                 </thead>
    304                 <tbody>
    305                 
    306                 {% for custom_field in payment_custom_fields %}
    307                 <tr>
    308                   <td>{{ custom_field.name }}</td>
    309                   <td>{{ custom_field.value }}</td>
    310                 </tr>
    311                 {% endfor %}
    312                   </tbody>
    313                 
    314               </table>
    315             </div>
    316             {% endif %}
    317             {% if shipping_method and shipping_custom_fields %}
    318             <div class="table-responsive">
    319               <table class="table table-bordered">
    320                 <thead>
    321                   <tr>
    322                     <td colspan="2">{{ text_shipping_custom_field }}</td>
    323                   </tr>
    324                 </thead>
    325                 <tbody>
    326                 
    327                 {% for custom_field in shipping_custom_fields %}
    328                 <tr>
    329                   <td>{{ custom_field.name }}</td>
    330                   <td>{{ custom_field.value }}</td>
    331                 </tr>
    332                 {% endfor %}
    333                   </tbody>
    334                 
    335               </table>
    336             </div>
    337             {% endif %}
    338             <div class="table-responsive">
    339               <table class="table table-bordered">
    340                 <thead>
    341                   <tr>
    342                     <td colspan="2">{{ text_browser }}</td>
    343                   </tr>
    344                 </thead>
    345                 <tbody>
    346                   <tr>
    347                     <td>{{ text_ip }}</td>
    348                     <td>{{ ip }}</td>
    349                   </tr>
    350                 {% if forwarded_ip %}
    351                 <tr>
    352                   <td>{{ text_forwarded_ip }}</td>
    353                   <td>{{ forwarded_ip }}</td>
    354                 </tr>
    355                 {% endif %}
    356                 <tr>
    357                   <td>{{ text_user_agent }}</td>
    358                   <td>{{ user_agent }}</td>
    359                 </tr>
    360                 <tr>
    361                   <td>{{ text_accept_language }}</td>
    362                   <td>{{ accept_language }}</td>
    363                 </tr>
    364                   </tbody>
    365                 
    366               </table>
    367             </div>
    368           </div>
    369           {% for tab in tabs %}
    370           <div class="tab-pane" id="tab-{{ tab.code }}">{{ tab.content }}</div>
    371           {% endfor %} </div>
    372       </div>
    373     </div>
    374   </div>
    375   <script type="text/javascript"><!--
    376 $(document).delegate('#button-invoice', 'click', function() {
    377 	$.ajax({
    378 		url: 'index.php?route=sale/order/createinvoiceno&user_token={{ user_token }}&order_id={{ order_id }}',
    379 		dataType: 'json',
    380 		beforeSend: function() {
    381 			$('#button-invoice').button('loading');
    382 		},
    383 		complete: function() {
    384 			$('#button-invoice').button('reset');
    385 		},
    386 		success: function(json) {
    387 			$('.alert-dismissible').remove();
    388 
    389 			if (json['error']) {
    390 				$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
    391 			}
    392 
    393 			if (json['invoice_no']) {
    394 				$('#invoice').html(json['invoice_no']);
    395 
    396 				$('#button-invoice').replaceWith('<button disabled="disabled" class="btn btn-success btn-xs"><i class="fa fa-cog"></i></button>');
    397 			}
    398 		},
    399 		error: function(xhr, ajaxOptions, thrownError) {
    400 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    401 		}
    402 	});
    403 });
    404 
    405 $(document).delegate('#button-reward-add', 'click', function() {
    406 	$.ajax({
    407 		url: 'index.php?route=sale/order/addreward&user_token={{ user_token }}&order_id={{ order_id }}',
    408 		type: 'post',
    409 		dataType: 'json',
    410 		beforeSend: function() {
    411 			$('#button-reward-add').button('loading');
    412 		},
    413 		complete: function() {
    414 			$('#button-reward-add').button('reset');
    415 		},
    416 		success: function(json) {
    417 			$('.alert-dismissible').remove();
    418 
    419 			if (json['error']) {
    420 				$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
    421 			}
    422 
    423 			if (json['success']) {
    424                 $('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
    425 
    426 				$('#button-reward-add').replaceWith('<button id="button-reward-remove" data-toggle="tooltip" title="{{ button_reward_remove }}" class="btn btn-danger btn-xs"><i class="fa fa-minus-circle"></i></button>');
    427 			}
    428 		},
    429 		error: function(xhr, ajaxOptions, thrownError) {
    430 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    431 		}
    432 	});
    433 });
    434 
    435 $(document).delegate('#button-reward-remove', 'click', function() {
    436 	$.ajax({
    437 		url: 'index.php?route=sale/order/removereward&user_token={{ user_token }}&order_id={{ order_id }}',
    438 		type: 'post',
    439 		dataType: 'json',
    440 		beforeSend: function() {
    441 			$('#button-reward-remove').button('loading');
    442 		},
    443 		complete: function() {
    444 			$('#button-reward-remove').button('reset');
    445 		},
    446 		success: function(json) {
    447 			$('.alert-dismissible').remove();
    448 
    449 			if (json['error']) {
    450 				$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
    451 			}
    452 
    453 			if (json['success']) {
    454                 $('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
    455 
    456 				$('#button-reward-remove').replaceWith('<button id="button-reward-add" data-toggle="tooltip" title="{{ button_reward_add }}" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>');
    457 			}
    458 		},
    459 		error: function(xhr, ajaxOptions, thrownError) {
    460 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    461 		}
    462 	});
    463 });
    464 
    465 $(document).delegate('#button-commission-add', 'click', function() {
    466 	$.ajax({
    467 		url: 'index.php?route=sale/order/addcommission&user_token={{ user_token }}&order_id={{ order_id }}',
    468 		type: 'post',
    469 		dataType: 'json',
    470 		beforeSend: function() {
    471 			$('#button-commission-add').button('loading');
    472 		},
    473 		complete: function() {
    474 			$('#button-commission-add').button('reset');
    475 		},
    476 		success: function(json) {
    477 			$('.alert-dismissible').remove();
    478 
    479 			if (json['error']) {
    480 				$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
    481 			}
    482 
    483 			if (json['success']) {
    484                 $('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
    485 
    486 				$('#button-commission-add').replaceWith('<button id="button-commission-remove" data-toggle="tooltip" title="{{ button_commission_remove }}" class="btn btn-danger btn-xs"><i class="fa fa-minus-circle"></i></button>');
    487 			}
    488 		},
    489 		error: function(xhr, ajaxOptions, thrownError) {
    490 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    491 		}
    492 	});
    493 });
    494 
    495 $(document).delegate('#button-commission-remove', 'click', function() {
    496 	$.ajax({
    497 		url: 'index.php?route=sale/order/removecommission&user_token={{ user_token }}&order_id={{ order_id }}',
    498 		type: 'post',
    499 		dataType: 'json',
    500 		beforeSend: function() {
    501 			$('#button-commission-remove').button('loading');
    502 		},
    503 		complete: function() {
    504 			$('#button-commission-remove').button('reset');
    505 		},
    506 		success: function(json) {
    507 			$('.alert-dismissible').remove();
    508 
    509 			if (json['error']) {
    510 				$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
    511 			}
    512 
    513 			if (json['success']) {
    514                 $('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
    515 
    516 				$('#button-commission-remove').replaceWith('<button id="button-commission-add" data-toggle="tooltip" title="{{ button_commission_add }}" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>');
    517 			}
    518 		},
    519 		error: function(xhr, ajaxOptions, thrownError) {
    520 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    521 		}
    522 	});
    523 });
    524 
    525 $('#history').delegate('.pagination a', 'click', function(e) {
    526 	e.preventDefault();
    527 
    528 	$('#history').load(this.href);
    529 });
    530 
    531 $('#history').load('index.php?route=sale/order/history&user_token={{ user_token }}&order_id={{ order_id }}');
    532 
    533 $('#button-history').on('click', function() {
    534 	$.ajax({
    535 		url: '{{ catalog }}index.php?route=api/order/history&api_token={{ api_token }}&store_id={{ store_id }}&order_id={{ order_id }}',
    536 		type: 'post',
    537 		dataType: 'json',
    538 		data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '&notify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()),
    539 		beforeSend: function() {
    540 			$('#button-history').button('loading');
    541 		},
    542 		complete: function() {
    543 			$('#button-history').button('reset');
    544 		},
    545 		success: function(json) {
    546 			$('.alert-dismissible').remove();
    547 
    548 			if (json['error']) {
    549 				$('#history').before('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
    550 			}
    551 
    552 			if (json['success']) {
    553 				$('#history').load('index.php?route=sale/order/history&user_token={{ user_token }}&order_id={{ order_id }}');
    554 
    555 				$('#history').before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
    556 
    557 				$('textarea[name=\'comment\']').val('');
    558 			}
    559 		},
    560 		error: function(xhr, ajaxOptions, thrownError) {
    561 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    562 		}
    563 	});
    564 });
    565 //--></script> 
    566 </div>
    567 {{ footer }}