So basically I had to disable Cash on Delivery if some particular products were in the cart.
For this I created a custom attribute called
Disable_COD and created a plugin which works around
isAvailable() and returns
false whenever the value for the attribute for any of the items in the cart is
This successfully removes the payment method.
But now I want to display text like:
Sorry! The Cash on Delivery payment method is unavailable because you have:
[item name(s)] in your cart. Please continue with online payment.
Instead of the place where the payment method was being displayed.
But I have no idea on how to proceed. All I know is:
This file is responsible for rendering the payment methods.
Any help would be appreciated!