Skip to content

Commit

Permalink
https://github.com/opencart/opencart/issues/13783
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed Apr 7, 2024
1 parent 626edc0 commit d71d291
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions upload/admin/view/template/customer/customer.twig
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,32 @@ $('#input-email').autocomplete({
$('#input-email').val(item['label']);
}
});
$('#customer').on('click', 'a[data-oc-toggle=\'unlock\']', function(e) {
e.preventDefault();
var element = this;
$.ajax({
url: $(element).attr('href'),
dataType: 'json',
success: function(json) {
console.log(json);
$('.alert-dismissible').remove();
if (json['error']) {
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
}
if (json['success']) {
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-circle-check"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
}
},
error: function(xhr, ajaxOptions, thrownError) {
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
//--></script>
{{ footer }}
2 changes: 1 addition & 1 deletion upload/admin/view/template/customer/customer_list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<ul class="dropdown-menu dropdown-menu-end">
<li><h6 class="dropdown-header">{{ text_option }}</h6></li>
{% if customer.unlock %}
<li><a href="{{ customer.unlock }}" class="dropdown-item"><i class="fa-solid fa-unlock"></i> {{ text_unlock }}</a></li>
<li><a href="{{ customer.unlock }}" data-oc-toggle="unlock" class="dropdown-item"><i class="fa-solid fa-unlock"></i> {{ text_unlock }}</a></li>
{% else %}
<li><a href="#" class="dropdown-item disabled"><i class="fa-solid fa-unlock"></i> {{ text_unlock }}</a></li>
{% endif %}
Expand Down

0 comments on commit d71d291

Please sign in to comment.