• Resolved cornerstonewebdev

    (@cornerstonewebdev)


    Distance Based Fee calculating a higher charge than it is supposed to.

    1) Divider = 1 & Price = 1. The intent is to charge $1 per 1 Mile for any delivery beyond 10 miles. Any delivery less than 10 miles from origination is supposed to be $10.00. (I could not figure out how to apply a minimum charge, so if the destination is less than 10 miles it is currently $0)
    2) In my current test – Google Maps shows 3 routes available from store location to delivery test location: 8.8, 9.5, and 12.0 miles one way travel.
    a. Calculation displayed on the cart is $16.80.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Gaylord Focker

    (@webdata)

    Hi,

    1) You can use base price for the shipping method. So you can set the minimum distance to 10 miles and then start to charge per mile.

    2) I believe API picks the fastest route and mode is “driving”.

    Also please note taxes affects the total cost as well.

    Kim

    Thread Starter cornerstonewebdev

    (@cornerstonewebdev)

    Hi:
    Thanks for the reply. I am very excited to use this plugin and provide a good review, but
    1) The calculation is not correct:
    a) Taxes are not turned on in Woocommerce as a whole, and the setting in WooCommerce Custom Shipping Method is set to “no”.
    b) I do not see any field titled “base price” in the WooCommerce Custom Shipping Method.
    c) The “fastest route” provided by Google Maps is 8.8 miles of the 3 options provided. The calculation should not add up to $16.8 no matter which option is chosen by the plugin when my divider is a 1 and my charge per mile is a 1.

    I hope these additional facts help. Yours is a great plugin. I just need to understand what setting needs to be set to in order for this plugin to charge a base price of $10 for .1-10miles and $1 per mile from 10.1-25 miles.

    I can send screen shots, or grant you access to the site if you reply to my email.

    Thanks
    GARY

    Plugin Author Gaylord Focker

    (@webdata)

    Can you give the origin address and destination address, so I can check the API response.

    You can use either “Fixed price” or “Handling costs” fields to add the base price.

    Kim

    Thread Starter cornerstonewebdev

    (@cornerstonewebdev)

    Hi Kim:

    Origin: 400 Buford Highway, Suwanee, GA, 30024
    Destination: 3665 Woodberry Dr, Duluth, GA, 30096

    Thanks for working through this with me.

    GARY

    Plugin Author Gaylord Focker

    (@webdata)

    Here is the API response:

    distance: 10.4 mi
    value: 16787

    I guess distance is fine, but value seems to be in meters. It seems Google API does not change the value, no matter if you use imperial or metric units parameter.

    I made now a little adjustment to the plugin code, so it will turn meters in to miles if you have chosen “Units – Miles” at the shipping method settings.

    Hopefully this little fix will help you to get more accurate pricing for the shipping.

    Kim

    Thread Starter cornerstonewebdev

    (@cornerstonewebdev)

    Kim:

    Thank you. I know there is a difference, even within Google, of calculated distances and I appreciate the fix, so the result at least falls in the middle of range of returned distances by google-maps.

    One last clarification please:
    I do not want to charge the fixed fee if the delivery destination is outside the minimum distance. The $10 fixed fee no longer applies, since the destination is greater than 10 miles. I only want to charge the result of the calculation.
    EX:
    1) Fixed fee of $10 for any destination 0-10 miles from origin.
    2) No fixed fee, and $1 per mile charge for any destination from 10.1 – 20 miles(limit of delivery area).

    Is there a way to accomplish this?

    Thanks
    GARY

    Plugin Author Gaylord Focker

    (@webdata)

    I guess you could use two shipping methods in a same shipping zone. One with fixed fee and maximum limited distance to 10 miles and another one with distance based fee and minimum limited distance to 10 miles. Also add the maximum distance to some huge number, like 9999 for example.

    Also update the plugin first – Hiding function now works better with the latest WooCommerce.

    Kim

    Thread Starter cornerstonewebdev

    (@cornerstonewebdev)

    Kim:

    Excellent idea. I will test it out and let you know.

    Thanks for the support.

    GARY

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Distance Based Fee Calculating too High’ is closed to new replies.