Добрый день, коллеги. Прошу помочь вставить код функции виртуальной страницы google analylics в файл product.tpl
Если я правильно разобрался, за кнопку купить отвечает кусок кода:
<script type="text/javascript"><!--
$('#button-cart').bind('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, information, .error').remove();
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
$('#option-' + i).after('<span class="error">' + json['error']['option'][i] + '</span>');
}
}
}
if (json['success']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').dialog({modal: true,buttons: {Ok: function() {$( this ).dialog( "close" );}}});
$('#cart-total').html(json['total']);
}
}
});
});
//--></script>
В этот код мне необходимо поместить фунцию:
onclick="_gaq.push(['_trackPageview', ' basket_add’]);
Очень прошу помочь, перерыл гугл и кучу форумов, решения не нашел.