Доброй ночи есть вопрос.CMS opencart. Есть кнопка Купить addToCart которая добавляет товар в корзину.
Как сделать чтобы она открывала страницу корзины не в фрейме а в новом окне.
вот код:
function addToCart(product_id, quantity) {
quantity = typeof(quantity) != 'undefined' ? quantity : 1;
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: 'product_id=' + product_id + '&quantity=' + quantity,
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information, .error').remove();
if (json['redirect']) {
location = json['redirect'];
}
if (json['success']) {
location.href='index.php?route=checkout/simplecheckout';
}
}
});
}