Magento: Cart, Payment method ordering

Magento: Cart, Payment method ordering

October 17, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento: Cart, Payment method ordering

Reordering Payment Methods on Magento Cart Page

In Magento, the order of payment methods displayed on the cart page is determined by the top_methods array in your checkout template file. In version 1.9.x, this array is generated based on the configuration settings found in the admin panel.

Understanding the Default Template

The default cart checkout template uses a foreach loop to iterate through the payment methods defined in the $this->getMethods('top_methods') function:

<ul class="checkout-types">
    <?php if($this->getContinueShoppingUrl()): ?>
        <li>
            <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue btn-inline" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')""><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
        </li>
    <?php endif; ?>
    <?php foreach ($this->getMethods('top_methods') as $method): ?>
        <?php if ($methodHtml = $this->getMethodHtml($method)): ?>
            <li><?php echo $methodHtml; ?></li>
        <?php endif; ?>
    <?php endforeach; ?>
</ul>

Here, the getMethods function retrieves an array of payment methods based on the specified code (top_methods), and the getMethodHtml function generates the HTML for each method.

Changing the Payment Method Order

To reorder the payment methods, you need to modify the top_methods configuration in your admin panel. Here’s how:

  1. Log in to your Magento admin interface.

  2. Navigate to System > Configuration.

  3. In the left menu, select Sales > Payment Methods.

  4. Scroll down to the “Order in Checkout Configuration” section.

    Payment Method Order

  5. Update the order of your payment methods:

    • Move the one-page checkout method (Pay Now) to the desired position after the Continue Shopping button.
    • Reorder Amazon Payments and PayPal Express Checkout accordingly.
  6. Save the configuration changes by clicking on “Save Config”.

Customizing the Cart Template

If you want more control over the payment method order, you can modify the checkout/cart.phtml template file directly:

  1. Open your Magento theme directory (usually located at app/design/frontend/{package}/{theme}/template/checkout).

  2. Locate and open the cart.phtml file.

    Cart Template File

  3. Update the foreach loop to manually reorder your payment methods:

<ul class="checkout-types">
    <li>
        <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue btn-inline" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')""><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
    </li>
    <li>
        <?php if ($methodHtml = $this->getMethodHtml($this->getMethods('top_methods')[1])): ?>
            <?php echo $methodHtml; ?>
        <?php endif; ?>
    </li>
    <!-- Add your custom order here -->
</ul>

Replace [1] with the index of your desired payment method.

  1. Save and close the file.

Conclusion

Reordering payment methods on the Magento cart page involves a combination of adjusting the admin panel configuration and potentially modifying the template files directly. By following the steps outlined in this guide, you should be able to achieve the desired order for your payment methods.

Remember that direct template modifications may require careful testing to ensure compatibility with future updates or extensions. It’s always a good practice to create child themes for such customizations to preserve your changes across Magento updates.

For more advanced customization techniques and best practices in Magento development, I recommend exploring the Magento documentation and checking out our previous blog posts on theme creation and layout modifications.

Magento 1 Checkout Themes Admin

Our network