Magento Redirect To Checkout After Adding To Cart An Easy How-To Guide

Magento Redirect To Checkout After Adding To Cart: An Easy How-To Guide

by Van Nguyen

“How to set up a quick buying process for customers to increase conversion rates and reduce abandoned rate”  is always an issue most of Magento store owners take much concern.

When customers add products to their cart by clicking “Add to Cart,” they will be redirected to the shopping cart page to view their selected products. There’s an option by Magento default for admins to choose to send the user to the cart or leave them on the page. However, this step takes time, and there is also a list of selected items displayed on the checkout page.

Therefore, to save time for customers, some shop Magento owners consider skipping the shopping cart page and directly redirecting customers to the checkout page. This makes customers buy products faster without waiting for loading the shopping cart page which can cause them to abandon their carts.


High abandoned cart rate due to long purchase process on Magento websites

In this blog post, we will introduce you (especially administrators of Magento online stores and developers) the way we can disable the shopping cart page to improve the buying process in your site.

Create a Magento redirect to checkout by using Event observer method

After products are added to carts,  it is a default process that the site will redirect to the shopping cart page. So how to disable loading the shopping cart page and redirect to Magento checkout page after “Add to cart” even when they access intentionally to the URL of the shopping cart?

The easiest way is by using the event observer method. It means that you take the “controller_action_predispatch_checkout_cart_index” event to redirect 301 from the cart page to the checkout page. This is the “fired” event before loading the “checkout_cart_index” page.

This following code is added to the declaration of event observer in the configuration file:


Enable or Disable module

You may want to enable or disable module in some cases, so you can add a Store Config in the backend to easily use. You create the config/system.xml file:

<?xml version="1.0"?>
<gotocheckout  translate="label" module="disablecart">                    
<label>Redirect Cart To Checkout</label>
<general translate="label">
<enable translate="label">


After finishing these code, you can see “Redirect Cart To Checkout” in the Configuration and then you can choose Yes or No to enable or disable it.


Redirect cart to checkout page in Magento sites

In the Model/Observer.php file, we declare disableCart

   public function disableCart(Varien_Event_Observer $observer){
   $storeId = Mage::app()->getStore()->getId();
   if(Mage::getStoreConfig('gotocheckout/general/enable', $storeId)){
    $controller = $observer->getControllerAction();

Tips: If the website uses the One Step Check Out module, it may have to redirect to the other URL of the checkout: ->setRedirect(Mage::getUrl(‘one step checkout’),301)

Finally, when you finish the setup, you need to clear out the cache and reload the page to test.

If you do not want to take much time for carrying out these things, you can quickly get the full functions by downloading the full version of the Disable cart module [DOWNLOAD HERE]Our module will provide you with all tasks without any efforts.

If our blog has brought you valuable knowledge, please Like and Subscribe to our blog to get the latest shares for your Magento site.

Moreover, let’s check out more latest Magento 2 extensions by BSS Commerce to install for your website and improve shopping experience as well as increase sales effectively!

Next Reading Suggestions

© 2019 BSS Commerce owned by THANH CONG INTER ., JSC. All Rights Reserved.
Business registration certificate no. 0106064469 issued by Hanoi Department of Planning and Investment on 19 December 2019.
Legal Representative: Mr. Nguyen Quang Trung.