Hello everyone,
Can someone help me out with this one please:
When adding a product to the cart i want to go directly to the checkout page instead of the cart page
what is the best way to do this please
thanks in advance
Can someone help me out with this one please:
When adding a product to the cart i want to go directly to the checkout page instead of the cart page
what is the best way to do this please
thanks in advance
In Development
Share this post:
Responses (3)
-
Accepted Answer
Hello,
Arastta doesn't redirect the customers after adding a product to the cart. Do you use a 3rd party extension to do that? If so, you need to modify the 3rd party extension itself.
Arastta, since 1.3, opens a modal window after adding a product to the cart. And there are "View Cart" and "Checkout" links in the modal window.
Regards. -
Accepted Answer
-
Accepted Answer
OK I see, I thought that it's already redirecting to the cart page because you said "go directly to the checkout page instead of the cart page". I will tell you how to achieve it below but please note that this modification will override some of the core files and not update-proof, so you will lose the modifications after an Arastta update. If you want this modification to be update-proof, I can provide you a custom work, so you can ask me.
So here is how you can manage it:
Open this file:
/catalog/controller/checkout/cart.php
And find this line:
$this->cart->add($product_id, $quantity, $option, $recurring_id);
Add this code just below:
$json['redirect'] = str_replace('&', '&', $this->url->link('checkout/checkout', ''));
And then open this file:
/catalog/view/theme/YOUR_THEME/template/product/product.tpl
and find this line:
if (json['success']) {
cart.after('add', json);
Add the following code just above it:
if (json['redirect']) {
location = json['redirect'];
}
That's all. But before trying, it's better to refreshing your modifications from Modification page (Extensions > Modification).
Regards
Your Reply
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »