Magento skip two steps in checkout

Magento skip two steps in checkout

October 8, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento skip two steps in checkout

Skipping Address Steps in Magento Checkout for Guest Users

As an e-commerce developer, you may face situations where guest users need to bypass certain steps in the checkout process if they have already added their addresses. In this post, we’ll explore how to achieve this directly from the saveCheckoutMethod method in your overridden Mage_Checkout_Model_Type_Onepage class.

The Current Approach and Limitations

The provided code attempts to skip the Billing Address (step 1) and Shipping Address (step 2) steps by setting both as ‘complete’ and allowing the Shipping Method step. However, this approach fails because it doesn’t account for the session state management required by Magento’s layered checkout process.

The Root Cause: Session State Mismanagement

The issue lies in the sequential execution of checkout steps. When a guest user adds an address, Magento saves this data in the session but keeps the checkout at step 1 (Select Shipping Method). Simply setting the steps as ‘complete’ doesn’t reflect this saved state back to the user’s current session context.

The Solution: Leveraging Checkout Session Functions

To solve this, we need to use Magento’s built-in functions for managing the checkout session and its progression. Here’s a corrected version of your code that handles the session state appropriately:

public function saveCheckoutMethod($method)
{
    if (empty($method)) {
        return array('error' => -1, 'message' => $this->helper()->__('Invalid data.'));
    }

    $this->getQuote()->setCheckoutMethod($method)->save();

    $quote = $this->getQuote();
    if ($quote->getBillingAddress()->validate() && $quote->getShippingAddress()->validate()) {
        // Set the steps as 'complete' and allow the next step using Magento's session functions
        $session = Mage::getSingleton('checkout/session');
        $session->unsCheckoutStepData();

        $this->getCheckout()
            ->setStepData('billing', 'complete', false)
            ->setStepData('shipping_address', 'complete', false)  // Corrected step name
            ->setStepData('shipping_method', 'allow', true);

        Mage::log("Setting step shipping_method.");
    } else {
        $this->getCheckout()->setStepData('billing', 'allow', true);
    }

    return array();
}

Key Changes and Best Practices

  1. Use the correct step name: In Magento, the Shipping Address step is actually named shipping_address, not just shipping. Using the correct name ensures the session state is updated correctly.

  2. Clear the checkout steps from the session: Before setting new steps, clear the existing data in the session to ensure a clean transition between steps. This avoids conflicts due to outdated data.

  3. Use Magento’s built-in functions: Instead of trying to manually set the session state, rely on Magento’s own session management and checkout progression functions. This ensures compatibility with future updates and prevents issues caused by direct database manipulation.

Conclusion

In this post, we’ve explored how to skip address steps in Magento for guest users who have already added their shipping and billing information. By leveraging Magento’s built-in session management functions, we can achieve a seamless transition between the checkout steps without resorting to manual data manipulation or session state overrides.

Remember that while these changes are effective within the saveCheckoutMethod method of your overridden class, it’s crucial to maintain compatibility with your core Magento files and ensure proper testing in various scenarios. For more advanced customizations and best practices, consider exploring Laravel Company’s e-commerce development services for expert guidance tailored to your specific needs.

Happy coding!

Checkout Configuration Customers Errors

Our network