Mátraházi Péter

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Mátraházi Péter
    Participant

    Hello, did you find a solution? I checked your website and it’s still displaying a free delivery message when shipping to eg. Azerbaijan…

    Mátraházi Péter
    Participant

    I found the reason for the bug. There was a code snippet in the child theme’s function php that was hiding the flat rate option if free shipping amount was reached:

    /**
    * @snippet Hide ALL shipping rates in ALL zones when Free Shipping is available
    * @author Rodolfo Melogli
    */

    add_filter( ‘woocommerce_package_rates’, ‘bbloomer_unset_shipping_when_free_is_available_all_zones’, 9999, 2 );

    function bbloomer_unset_shipping_when_free_is_available_all_zones( $rates, $package ) {
    $all_free_rates = array();
    foreach ( $rates as $rate_id => $rate ) {
    if ( ‘free_shipping’ === $rate->method_id ) {
    $all_free_rates[ $rate_id ] = $rate;
    break;
    }
    }
    if ( empty( $all_free_rates )) {
    return $rates;
    } else {
    return $all_free_rates;
    }
    }

    But unfortunately now we are having an issue with the flat rate shipping not disappearing when the free amount reached, even though it is set in the admin. Does anyone have some advice on that? Thank you!

    Mátraházi Péter
    Participant

    Dear Moshtafizur,

    We have enabled and set up the manual amounts for different user roles (customer, retailer), shipping zones (Italy) and methods (“flat rate GLS” and “free delivery”).

    In our example a customer can get free shippping from € 75, but a retailer from € 200 (but he has a discount on prices and has a bigger box to deliver).

    From zero to € 75 everything works fine, the amount for free delivery is showing everywhere, and the default flat rate (GLS) shipping is added to the order in any case.

    From € 75 – 200 a strange bug appears for retailers: the amount left is showing as it should, but the shipping option is already changed to free delivery.
    For normal customers it works fine, because they already reached their amount.

    Over € 200 it works fine for retailers too.

    So it seems like the default minimum amount (75) is somehow still affecting the shipping table display for users with higher min amounts (200).
    I tried to play around with the options without success eg. set the min amount to 200, but then it added the GLS post cost and displayed free delivery reached.

    Is it an error of the theme we use (a child of Naturally by Ninetheme) or might be a bug in the plugin?

    Thank you, any help is much appreciated!

Viewing 3 posts - 1 through 3 (of 3 total)