• Resolved giulioschiavo

    (@giulioschiavo)


    Hi,
    I’m only using the distance fee function.
    I got an additional fee even if destination address is less than the minimum setting. Even if I enter the same address I got cents added.
    This doesn’t happen only if I input the same street number.

    I’m using a fixed 1.00 fee plus 0.30 fee every 1 extra km (minimum distance 3 km)

    Thank you.

    • This topic was modified 3 years, 12 months ago by giulioschiavo.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Gaylord Focker

    (@webdata)

    Hi,

    Can you give me origin address and destination address, so I can check the API response and I can try to recreate your issue myself.

    Kim

    Thread Starter giulioschiavo

    (@giulioschiavo)

    Sorry to say that I made a mistake; I’m using “ WebData Custom Shipping Methods for WooCommerce” plugin, not this one.
    Don’t know if they share same code.

    Anyway:
    Origin/Store address: Via Amendola 25 – 98071 Capo d’Orlando (ME) {written without apostrophe to avoid backslashes}

    Destination: Via Amendola 5 – 98071 Capo d’Orlando (ME)

    – Italy, Sicily –

    Plugin Author Gaylord Focker

    (@webdata)

    Ok, here is the response:
    {“destination_addresses”:[“Via Giovanni Amendola, 5, 98071 Capo d’Orlando ME, Italy”],”origin_addresses”:[“Via Giovanni Amendola, 25, 98071 Capo d’Orlando ME, Italy”],”rows”:[{“elements”:[{“distance”:{“text”:”0.4 km“,”value”:395},”duration”:{“text”:”2 mins”,”value”:117},”status”:”OK”}]}],”status”:”OK”}

    So if you add price 1 and divider 1, you should get 0.4EUR for the shipping. If you get any more than that, then check you don’t have any additional fees for your shipping.

    Minimum and maximum values are used for limiting the shipping method’s visibility. You can set the minimum to 3km for example so the shipping method won’t show up until the distance from your shop to customers location is more than 3 kilometers.

    However you can set up 2 or more shipping methods. One with the fixed fee for 3km distance. Minimum distance 0, maximum distance 3 and then set fixed fee for this shipping method.

    Then add another shipping method where minimum distance is 3.1 and maximum distance is some large number, e.g. 9999. Then add the divider and fee as you wish and leave the fixed fee field empty.

    Kim

    Thread Starter giulioschiavo

    (@giulioschiavo)

    I got your solution, thank you.
    There is still one problem:
    – I have a fixed fee of 1€ for all orders
    – if distance is more than 3km BUT order has a minimum of 10€, then shipping fee will be 1€.
    – if distance is more than 3km AND order is less than 10€, than shipping fee will be 1€ plus 0.30 * extra km.
    – if distance is less or equal than 3km, shipping fee will be 1€ without a minimum amount.

    I see that we have an option for “Hide if limits are exceeded”, I guess that to make it working like I said, we should have an option also to hide ONLY the distance fee rates if the minimum amount is reached.

    • This reply was modified 3 years, 12 months ago by giulioschiavo.
    Plugin Author Gaylord Focker

    (@webdata)

    There are hooks to manipulate the calculation formula, in case you need.
    See the docs for more info: https://web-data.online/docs/woocommerce-custom-shipping-methods/#developers

    Kim

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Min distance calculation’ is closed to new replies.