How to Make Cash on Delivery Dependent on Shipping Address in Magento 1.9

cash-on-deliverymagento-1.9payment-methodsshipping

I've made my admin configuration for cash on delivery payment as applicable only to specific country i.e, USA

Below my cases in checkout page,

Billing Country => USA, Shipping Country => USA | COD Available
Billing Country => USA, Shipping Country => OTHER | COD Available
Billing Country => OTHER, Shipping Country => USA | COD Not Available
Billing Country => OTHER, Shipping Country => OTHER | COD Not Available

So this clearly shows that COD configuration of applicable country is pointing only to billing address.

Any way to make this condition to check shipping country instead of billing country ?

Best Answer

You would have to make a extension that observes payment_method_is_active event and decide if your method is active or not