There are no pre-requisites in order for you to be able to implement this solution.
Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.
Need support with the snippet? We’re Here to Help You, Contact Us!
Firstly, it’s important to check you with your payment gateway provider and the appropriate laws that you are allowed to pass on fees for specific payment method selection before implementing fees. This guide shows you how you can add a fixed fee to the order as an order item based on the customers selected payment method. Specifically, this guide shows you how you can add a fixed (your currency here)5 fee to the order if the payment method Cash On Delivery is selected. A label is also added adjacent to the specific payment method with the fixed fee amount to make it super clear an additional cost will be added if said payment method is selected. You will need the Payment Method ID to implement this solution to meet your needs. Cash On Delivery’s Payment Method ID is ‘cod’ for example. You can get the Payment Method ID by using your browsers developer tools to inspect the payment gateway radio button. This is explained further on.
Use your browsers developer tools to inspect the payment gateway you’d like to add the fee to, then copy the input value:
Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.