What version of OpenCart are you reporting this for?
3.0.3.8 maintenance
Describe the bug
Just a small bug
When a error in the guest shipping occurs, only a part of the div turns red, the message shows up etc. When you correct the error, the error message disappears, but the red border (has-error class) doesn't disappear.
To Reproduce
Checkout as a guest, fill in a wrong value for one of the inputs in the shipping address section and correct it.
Expected behavior
The has-error class should disappear and the red accent around the input field should turn back to black.
Screenshots
Creating errors:

Fixing errors:

Additional context
I think I found the problem:
The guest shipping (guest_shipping.twig) has a extra div around the input:
Code: Select all
<div class="form-group">
<label class="col-sm-2 control-label" for="input-shipping-company">{{ entry_company }}</label>
<div class="col-sm-10">
<input type="text" name="company" value="{{ company }}" placeholder="{{ entry_company }}" id="input-shipping-company" class="form-control" />
</div>
</div>
// Highlight any found errors
Code: Select all
$('.text-danger').parent().addClass('has-error');
But this is only the col-sm-10 div, so it explains why the label doesn't turn red.
Code: Select all
$('.alert-dismissible, .text-danger').remove();
$('.form-group').removeClass('has-error');
Simple fix
Just rewrite the JS line from above to:
Code: Select all
// Highlight any found errors
$('.text-danger').parent().parent().addClass('has-error');