If the Commission by Distance setting is not calculating as expected in Local Delivery Drivers for WooCommerce Premium, follow the steps below to diagnose and resolve the issue.
1. Check API Key Configuration
- Go to Plugin Settings › General
- Ensure both Google API keys are entered (website-restricted and server-restricted)
2. Enable Commission by Distance
- Go to Plugin Settings › Drivers
- Under the Commission section, select Distance-Based from the dropdown menu
3. Review the Order Notes
- Go to WooCommerce › Orders, then open the order in question
- Scroll to the Order Notes panel
- If the distance calculation failed, you will see an error message from the Google Distance Matrix API
- Follow the instructions in the error. Most commonly, you need to add your server’s IP address to the allowed list in your Google API console
4. Test the Commission Workflow
To verify that Commission by Distance is working:
- Go to the WooCommerce Order Edit Page
- Assign a driver to the order
- Make sure the Commission field is empty
- If a value exists, delete it and click Update Order
- Change the order status to any status other than Complete and click Update
- Then change the order status to Complete and click Update again
- The plugin will automatically populate the Commission field with a value based on the distance
5. Still Having Issues?
If the commission is still not calculated:
- Recheck that all required APIs are enabled: Distance Matrix API and Geocoding API
- Make sure the shipping address is valid and recognized by Google Maps
- Confirm that there are no API errors in the order notes
If you need help resolving the issue, email apowerfulwp@gmail.com with:
- The order ID
- A screenshot of the error or missing value
- Your current commission and API settings