Вот HTML код корзины:
<button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle">
<span id="cart-total">0</span>
<span class="cart-icon"></span>
</button>
где:
<span class="cart-icon"></span>
изображение корзины
после добавления товара:
<button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle">
<span id="cart-total">0</span>
</button>
т.е. <span class="cart-icon"></span>
отсутствует
---------------------------------------------------
common.js
// Cart add remove functions
var cart = {
'add': function(product_id, quantity) {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
dataType: 'json',
success: function(json) {
if (json['redirect']) {
location = json['redirect'];
}
if (json['success']) {
$.notify({
message: json['success'],
target: '_blank'
},{
// settings
element: 'body',
position: null,
type: "info",
allow_dismiss: true,
newest_on_top: false,
placement: {
from: "top",
align: "center"
},
offset: 0,
spacing: 10,
z_index: 2031,
delay: 5000,
timer: 1000,
url_target: '_blank',
mouse_over: null,
animate: {
enter: 'animated fadeInDown'
//exit: 'animated fadeOutUp'
},
onShow: null,
onShown: null,
onClose: null,
onClosed: null,
icon_type: 'class',
template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-success" role="alert">' +
'<button type="button" aria-hidden="true" class="close" data-notify="dismiss"> ×</button>' +
'<span data-notify="message"><i class="fa fa-check-circle"></i> {2}</span>' +
'<div class="progress" data-notify="progressbar">' +
'<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
'</div>' +
'<a href="{3}" target="{4}" data-notify="url"></a>' +
'</div>'
});
$('#cart > ul').load('index.php?route=common/cart/info ul li');
$('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>');
}
}
});
},
'update': function(key, quantity) {
$.ajax({
url: 'index.php?route=checkout/cart/edit',
type: 'post',
data: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
dataType: 'json',
success: function(json) {
if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') {
location = 'index.php?route=checkout/cart';
} else {
$('#cart > ul').load('index.php?route=common/cart/info cart_prod');
$('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>');
}
}
});
},