Выводит этот скрипт:
<script type="text/javascript"><!--
$('#button-cart').on('click', function() {
$.ajax({
url: 'index.php?route=extension/soconfig/cart/add',
type: 'post',
data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
dataType: 'json',
beforeSend: function() {
$('#button-cart').button('loading');
},
complete: function() {
$('#button-cart').button('reset');
},
success: function(json) {
$('.alert').remove();
$('.text-danger').remove();
$('.form-group').removeClass('has-error');
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
var element = $('#input-option' + i.replace('_', '-'));
{% if option_data %}
if(typeof ProductOptionId !== undefined && ProductOptionId==i.replace('_', '-')){
$('.so-colorswatch-productpage-icons').after('<div class="text-danger">' + json['error']['option'] + '</div>');
}
{% endif %}
if (element.parent().hasClass('input-group')) {
element.parent().after('<div class="text-danger">' + json['error']['option'] + '</div>');
} else {
element.after('<div class="text-danger">' + json['error']['option'] + '</div>');
}
}
}
if (json['error']['recurring']) {
$('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
}
// Highlight any found errors
$('.text-danger').parent().addClass('has-error');
}
if (json['success']) {
$('.text-danger').remove();
/*Leader custom code*/
$('#previewModal').modal('show');
$('#previewModal .modal-body').load('index.php?route=extension/soconfig/cart/info&product_id=/'+ {{ product_id }});
/*End Leader custom code*/
$('#cart .total-shopping-cart ').html(json['total'] );
$('#cart > ul').load('index.php?route=common/cart/info ul li');
$('.so-groups-sticky .popup-mycart .popup-content').load('index.php?route=extension/module/so_tools/info .popup-content .cart-header');
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
$('#button-checkout').on('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
dataType: 'json',
beforeSend: function() {
$('#button-checkout').button('loading');
},
complete: function() {
$('#button-checkout').button('reset');
},
success: function(json) {
$('.alert').remove();
$('.text-danger').remove();
$('.form-group').removeClass('has-error');
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
var element = $('#input-option' + i.replace('_', '-'));
{% if option_data %}
if(typeof ProductOptionId !== undefined && ProductOptionId==i.replace('_', '-')){
$('.so-colorswatch-productpage-icons').after('<div class="text-danger">' + json['error']['option'] + '</div>');
}
{% endif %}
{% if option_data %}
if(ProductOptionId != undefined && ProductOptionId==i.replace('_', '-')){
$('.so-colorswatch-productpage-icons').after('<div class="text-danger">' + json['error']['option'] + '</div>');
}
{% endif %}
if (element.parent().hasClass('input-group')) {
element.parent().after('<div class="text-danger">' + json['error']['option'] + '</div>');
} else {
element.after('<div class="text-danger">' + json['error']['option'] + '</div>');
}
}
}
if (json['error']['recurring']) {
$('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
}
// Highlight any found errors
$('.text-danger').parent().addClass('has-error');
}
if (json['success']) {
$('.text-danger').remove();
$('#cart .total-shopping-cart ').html(json['total'] );
window.location.href = "index.php?route=checkout/checkout";
}
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
//--></script>