Adobe Commerce provides the opportunity to show the shopping method even though it's not available for the given card. This behaviour can be applied by setting the value of Configuration / Sales / Shipping Method / Free Shipping / Show Method if Not Applicable config field to Yes.
Even though the shipping method is transferred to the frontend, method_code of this shipping method will be empty. This triggers the issue of undefined method_code.
This PR solves this issue by unsetting the shipping method if it's not available just by checking the value of available property.
Tested scenarios
Two shipping methods of which one of them is unavailable but set to be shown on the checkout.
Summary
Adobe Commerce provides the opportunity to show the shopping method even though it's not available for the given card. This behaviour can be applied by setting the value of
Configuration / Sales / Shipping Method / Free Shipping / Show Method if Not Applicable
config field toYes
.Even though the shipping method is transferred to the frontend,
method_code
of this shipping method will be empty. This triggers the issue of undefined method_code.This PR solves this issue by unsetting the shipping method if it's not available just by checking the value of
available
property.Tested scenarios