- 20 Ago 2014, 13:26
#52978
Bom dia pessoal.
Gostaria de redirecionar o Add To Cart para Checkout direto.
Pesquisei e os arquivos que tenho de modificar são o catalog/view/theme/meu tema/template/product/product.tpl e o /catalog/view/javascript/common.js
Tem que adicionar essa linha, ja tentei em varias, talvez pelo tema não esteja conseguindo, alguém pode dar uma luz?
Onde devo inserir? Devo remover algo?
Agradeço;
window.location='index.php?route=checkout/cart';
Arquivo commom.js
Gostaria de redirecionar o Add To Cart para Checkout direto.
Pesquisei e os arquivos que tenho de modificar são o catalog/view/theme/meu tema/template/product/product.tpl e o /catalog/view/javascript/common.js
Tem que adicionar essa linha, ja tentei em varias, talvez pelo tema não esteja conseguindo, alguém pode dar uma luz?
Onde devo inserir? Devo remover algo?
Agradeço;
window.location='index.php?route=checkout/cart';
Arquivo commom.js
Código: Selecionar todos
Arquivo product.tplfunction 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']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').fadeIn('slow');
$('#cart-total').html(json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
}
}
});
}Código: Selecionar todos
//--></script>
<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();
$('.option input, .option textarea').removeClass("input-error");
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
$('#option-' + i + ' input, #option-' + i + ' textarea').addClass("input-error");
$('#option-' + i).after('<span class="error" style="clear:both;position:relative;margin-top:8px;padding-bottom:4px">' + json['error']['option'][i] + '</span>');
}
}
}
if (json['success']) {
$('#notification').html('<div class="notification"><div class="close"></div>' + json['success'] + '</div>');
$('#cart_block').load('index.php?route=module/cart #cart_block > *');
$('.success').fadeIn('slow');
}
}
});
});
//--></script>
Editado pela última vez por hyogadecisne em 20 Ago 2014, 15:45, em um total de 1 vez.







