Skip to content

Zero Subtotal Checkout

Admin Configuration Options

There are a number of admin configuration options related to this feature. As always these can be found by logging into the admin and navigating to Stores -> Settings -> Configuration -> Hyvä Themes -> Checkout.

Remove Non-Zero Payment Methods

Path: Components -> Payment

Default Value: No

Enabling this option will remove all but a subset of available payment methods from the checkout when no payment information is required from the customer due to an order value of zero.

Payment Methods to Show for Zero Subtotal Checkout

Path: Components -> Payment

Default Value: No Payment Information Required (free)

This option lists all the installed payment methods, including disabled payment methods which are suffixed with (disabled). Any payment method(s) selected from this list will NOT be removed from the checkout when the customer's order value is zero.

Implementation Notes

Payment Method Availability

While the source model for the list of payment methods will display every payment method, only those methods that Magento deems to be available will be presented to the customer. This is because, ultimately, Magento uses the Magento\Payment\Api\PaymentMethodListInterface::getActiveList() function as a filter when supplying the list of available payment methods. This means the customer cannot select a disabled payment method without additional customisation.

The zero subtotal payment methods are filtered using the Hyva\Checkout\Plugin\Magento\Quote\Api\PaymentMethodManagementInterface::afterGetList() function.

Zero Total Validator

By default, Magento will only permit the free payment method to be used for zero subtotal orders. The Hyvä checkout implementation of this feature does not impose that restriction and this is achieved by substituting the default validator (Magento\Payment\Model\Checks\ZeroTotal) with a custom one (Hyva\Checkout\Model\Payment\Checks\ZeroTotal).