i want to show cash on delivery method during checkout, only for registered users.
if user is logged in show cash on delivery method otherwise not.
Please suggest in which file should i make the edit
cash-on-deliveryonepage-checkout
i want to show cash on delivery method during checkout, only for registered users.
if user is logged in show cash on delivery method otherwise not.
Please suggest in which file should i make the edit
Best Answer
You can use the event
payment_method_is_active
.Create an observer on that and you will get the payment method instance as a parameter.
Check if the customer is logged in deactivate it if it's not.
Something like this:
More info about the event observers can be found here