PS-WebAgentur Posted February 12, 2017 Share Posted February 12, 2017 Hi hope someone can help me with the problem. How I can go directly to the checkout / cart when I'm clicking on "Add to cart"-Button on the product-site. I don't want to show the modal-dialog (popup with information and the opinion to go back or to the cart). It should go faster for the customer. They just have to buy one article. Hope you can help me. I've searched for hours ... : Greetings Philipp 1 Link to comment Share on other sites More sharing options...
rocky Posted February 13, 2017 Share Posted February 13, 2017 Try going to the Modules and Services tab, clicking the Configure button on the "Cart block" module, changing "Ajax cart" to "No", and then clicking the "Save" button. Link to comment Share on other sites More sharing options...
PS-WebAgentur Posted February 15, 2017 Author Share Posted February 15, 2017 (edited) Thank you for the tip. I've tried this before, but then nothing happens. The customer remains on the product page, the product lands in the shopping cart, but you have to go to the checkout manually. How I can edit the code in the product-add-to-cart.tpl, so that the customer is automatically sent to checkout? Can you help me or need you the url of the website? <div class="add"> <button class="btn btn-primary add-to-cart" data-button-action="add-to-cart" type="submit" {if !$product.add_to_cart_url || $product.quantity_wanted>$product.quantity}disabled{/if}> <i class="material-icons shopping-cart"></i> {l s='Add to cart' d='Shop.Theme.Actions'} </button> Edited February 15, 2017 by PS-WebAgentur (see edit history) 1 Link to comment Share on other sites More sharing options...
qroft Posted May 20, 2017 Share Posted May 20, 2017 Thank you for the tip. I've tried this before, but then nothing happens. The customer remains on the product page, the product lands in the shopping cart, but you have to go to the checkout manually. How I can edit the code in the product-add-to-cart.tpl, so that the customer is automatically sent to checkout? Can you help me or need you the url of the website? <div class="add"> <button class="btn btn-primary add-to-cart" data-button-action="add-to-cart" type="submit" {if !$product.add_to_cart_url || $product.quantity_wanted>$product.quantity}disabled{/if}> <i class="material-icons shopping-cart"></i> {l s='Add to cart' d='Shop.Theme.Actions'} </button> Have you solved this? At the moment i am only thinking about solving it via a javascript onclick function, but i think this is the wrong way. Link to comment Share on other sites More sharing options...
theillo Posted May 22, 2020 Share Posted May 22, 2020 I'm wondering the same thing right now. When disabling AJAX cart, then it just redirects me to a /cart instead of to /order I will research more and post my findings. Link to comment Share on other sites More sharing options...
theillo Posted May 22, 2020 Share Posted May 22, 2020 Here's a module to do just that, in case you just wanna throw money at the problem...https://www.knowband.com/blog/user-manual/prestashop-one-click-checkout/ Link to comment Share on other sites More sharing options...
theillo Posted May 22, 2020 Share Posted May 22, 2020 You can do it with the hook actionCartSave Create a module, or upgrade an existing module, let it install this hook, then create this function in the module: public function hookActionCartSave($params){ Tools::redirect('order'); } Now anytime you're adding, removing, or somehow updating the cart, it will redirect you to order.php Quote actionCartSave After a product is added to the cart or if the cart’s content is modified Located in: /classes/Cart.php https://devdocs.prestashop.com/1.7/modules/concepts/hooks/list-of-hooks/ Link to comment Share on other sites More sharing options...
theillo Posted May 22, 2020 Share Posted May 22, 2020 (edited) Also, I've gone straight up into the template file checkout/cart.tpl and replaced everything in there with {Tools::redirect('order')} There's absolutely no point to having this "cart" page, all it does is make the customer jump through another hoop before clicking the "pay now" button, especially since checkout.tpl (which is the file you see when you go to the order contoller) - especially since this file looks almost the same as cart.tpl 🙄 Edit: This definitely causes glitches sometimes. May be better to create a cart.tpl that looks identical to checkout.tpl in case a customer ever visits /cart or for whatever other reason they might land on this page. It's definitely possible to delete /cart in back office (Shop Parameters -> SEO & URLs). {$product.add_to_cart_url} will then be resolved to /index.php?controller=cart instead of /cart Of course, this may still lead to a customer sometimes being taken to index.php?controller=cart, so the cart.tpl still needs to be optimized for checkout. Edited May 22, 2020 by theillo (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now