Добрый день, понадобилось добавить кнопку - купить, в выпадающем блоке корзины в шапке. Добавила в blockcart.tpl и в ajax-cart.jsvar domIdProduct = this.id + '_' + (this.idCombination ? this.idCombination : '0') + '_' + (this.idAddressDelivery ? this.idAddressDelivery : '0');
var domIdProductAttribute = this.id + '_' + (this.idCombination ? this.idCombination : '0');
if ($('dt[data-id="cart_block_product_' + domIdProduct + '"]').length == 0)
{
var productId = parseInt(this.id);
var productAttributeId = (this.hasAttributes ? parseInt(this.attributes) : 0);
var content = '<dt class="unvisible" data-id="cart_block_product_' + domIdProduct + '">';
var name = $.trim($('<span />').html(this.name).text());
name = (name.length > 12 ? name.substring(0, 10) + '...' : name);
content += '<a class="cart-images" href="' + this.link + '" title="' + name + '"><img src="' + this.image_cart + '" alt="' + this.name + '"></a>';
content += '<a class="button ajax_add_to_cart_button" href="' + this.link + '"></a>';
content += '<div class="cart-info"><div class="product-name">' + '<span class="quantity-formated"><span class="quantity">' + this.quantity + '</span> x </span><a href="' + this.link + '" title="' + this.name + '" class="cart_block_product_name">' + name + '</a></div>';
if (this.hasAttributes)
content += '<div class="product-atributes"><a href="' + this.link + '" title="' + this.name + '">' + this.attributes + '</a></div>';
if (typeof (freeProductTranslation) != 'undefined')
content += '<span class="price">' + (parseFloat(this.price_float) > 0 ? this.priceByLine : freeProductTranslation) + '</span></div>';
if (typeof (this.is_gift) == 'undefined' || this.is_gift == 0)
content += '<span class="remove_link"><a rel="nofollow" class="ajax_cart_block_remove_link" href="' + baseUri + '?controller=cart&delete=1&id_product=' + productId + '&token=' + static_token + (this.hasAttributes ? '&ipa=' + parseInt(this.idCombination) : '') + '"> </a></span>';
else
content += '<span class="remove_link"></span>';
content += '</dt>';
if (this.hasAttributes)
content += '<dd data-id="cart_block_combination_of_' + domIdProduct + '" class="unvisible">';
if (this.hasCustomizedDatas)
content += ajaxCart.displayNewCustomizedDatas(this);
if (this.hasAttributes)
content += '</dd>';
$('.cart_block dl.products').append(content);
}
Но проблема, что кнопка добавляется только после перезагрузки страницы, как сделать , чтобы она сразу появлялась при добавлении товара в корзину.