Removing the payment method selection step from the Magento 2 checkout process involves several key steps. This guide will walk you through the process of achieving this for your client’s Open Source 2.3.2 setup.
Step 1: Understanding the Checkout Process
The Magento 2 checkout is a multi-step process that includes steps like shopping cart, shipping information, payment method selection, and order review. By default, the “Payment Method” step is enabled to allow customers to select their preferred payment gateway before finalizing an order.
Step 2: Disable Payment Methods from Admin
Firstly, let’s disable all available payment methods from the Magento admin panel:
- Log in to your Magento admin.
- Navigate to Stores > Configuration > Sales > Payment Methods.
- Set the “Enabled” option for each payment method to “No”.
- Save the configuration.
This step ensures that no payment options are shown to customers during checkout, but it doesn’t completely remove the payment method selection step.
Step 3: Override Checkout Layout Files
To fully remove the payment method step, you need to override the checkout layout files from your theme or using a custom extension.
- Navigate to your theme directory (or create a new module) and locate the file
app/design/frontend/[package]/[theme]/Magento_Checkout/layout/checkout_index_index.xml. - Open this file in a code editor.
- Find the
<referenceBlock name="checkout.root" template="Magento_Checkout/template/form.phtml" />element. - Remove or comment out the following line:
<block class="Magento\Checkout\Block\Onepage\PaymentInformation" name="payment-methods-block"> <action method="setTemplate"> <argument name="template" xsi:type="string">Magento_Payment/onepage/payment.phtml</argument> </action> </block> - Save the file.
Step 4: Clear Cache and Reindex
After making these changes, clear your Magento cache and reindex data:
- In the admin panel, go to System > Tools > Cache Management.
- Select all cache types and click “Flush Magento Cache”.
- Then, navigate to System > Index Management.
- Click “Reindex All”.
Conclusion
By following these steps, you have successfully removed the payment method selection step from your client’s Magento 2 checkout process.
Remember that this approach assumes a specific business need where customers do not require any payment method options during checkout. It is crucial to ensure this aligns with your client’s business model and customer expectations.
For more advanced customizations or complex requirements, consider exploring the Magento Marketplace for extensions that can provide additional functionality and support your specific needs.
The Magento 2 documentation provides detailed insights into the checkout process and available configuration options. You can find more information in the official Magento Developer Documentation.
If you have any further questions or need assistance with other Magento customizations, feel free to reach out to our team at Laravel Company. We specialize in providing expert Magento development services tailored to your business requirements.