Add a product to cart and redirect to checkout page.

To redirect to checkout open catalog/view/theme/[your-theme]/js/custom.js and catalog/view/theme/[your-theme]/template/product/product.tpl

In both files find the following code:

[code lang=”js”]

if (json[‘success’]) {
$(‘#notification’).html(‘<div class="alert success">’ + json[‘success’] + ‘<a class="close" data-dismiss="alert" href="#">&times;</a></div>’);
$(‘.alert success’).fadeIn(‘slow’);
$(‘#cart-total’).html(json[‘total’]);
$(‘html, body’).animate({ scrollTop: 0 }, ‘slow’);
}

[/code]

And replace with:

[code lang=”js”]

if (json[‘success’]) {
window.location=’index.php?route=checkout/checkout’;
}

[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *