После добавления товара в корзину получается вот такое вот безобразие:
<span id="cart-total"> 1 3030р.</span><span class="mycart"><span>Корзина</span><span class="total-price">0.00</span>
понятно что в браузере криво отображается
а должно быть так:
<span id="cart-total">1</span><span class="mycart"><span>Корзина</span><span class="total-price">3030р.</span>
при этом после обновления страницы все становится нормально
Opencart 3
может тут что не так?
<div id="cart" class="btn-group btn-block">
<button type="button" data-toggle="dropdown" data-loading-text="{{ text_loading }}" class="btn dropdown-toggle"><i class="ion-bag"></i><span id="cart-total">{{ text_items }}</span><span class="mycart"><span>{{ text_items2 }}</span><span class="total-price">{% if total.text %}{{ total.text }}{% else %}{{ '0.00' }}{% endif %}</span></span></button>
<ul class="dropdown-menu pull-right">
{% if products or vouchers %}
<li class="has-scroll">
<table class="table">
{% for product in products %}
<tr>
<td class="text-center">{% if product.thumb %} <a href="{{ product.href }}"><img class="cart-image" src="{{ product.thumb }}" alt="{{ product.name }}" title="{{ product.name }}" /></a> {% endif %}</td>
<td class="text-left info-item"><a href="{{ product.href }}">{{ product.name }}</a> {% if product.option %}
{% for option in product.option %} <br />
- <small>{{ option.name }} {{ option.value }}</small> {% endfor %}
{% endif %}
{% if product.recurring %} <br />
- <small>{{ text_recurring }} {{ product.recurring }}</small> {% endif %}
<p class="cart-quantity">×{{ product.quantity }}</p>
<p class="cart-price">{{ product.total }}</p>
</td>
<td class="text-center cart-close"><button type="button" onclick="cart.remove('{{ product.cart_id }}');" title="{{ button_remove }}" class="btn btn-danger btn-xs"><i class="ion-android-close"></i></button></td>
</tr>
{% endfor %}
{% for voucher in vouchers %}
<tr>
<td class="text-center"></td>
<td class="text-left">{{ voucher.description }}</td>
<td class="text-right">x 1</td>
<td class="text-right">{{ voucher.amount }}</td>
<td class="text-center text-danger"><button type="button" onclick="voucher.remove('{{ voucher.key }}');" title="{{ button_remove }}" class="btn btn-danger btn-xs"><i class="ion-android-close"></i></button></td>
</tr>
{% endfor %}
</table>
</li>
<li>
<table class="table">
{% for total in totals %}
<tr>
<td class="text-left">{{ total.title ~ " :" }}</td>
<td class="text-right">{{ total.text }}</td>
</tr>
{% endfor %}
</table>
<p class="text-center cart-button"><a href="{{ cart }}">{{ text_cart }}</a><a href="{{ checkout }}">{{ text_checkout }}</a></p>
</li>
{% else %}
<li>
<p class="text-center cart-empty">{{ text_empty }}</p>
</li>
{% endif %}
</ul>
</div>
<script type="text/javascript">
$(document).ready(function () {
var total = $('#cart .table .text-right').html();
$('#cart .total-price').html(total);
});
</script>
в коде я не сильно разбираюсь
Подскажите куда копать и в чем может быть проблема?