• Resolved Bazan

    (@bazan)


    I’ve found a problem with a default woocommerce payment gateway – cash on delivery (COD).

    In COD gateway settings page we can add shipping methods where we want to use COD gateway, and there is a position “flexible shipping”.

    1. First problem is that the algorithm to show selectbox with shipping methods is using a gateway title instead of gateway id.
    2. Due to “Shipping method” plugin in fact creates a 2 gateways – flexible_shipping and flexible_shipping_info but both have the same title – Flexible Shipping
    3. finally – even when due to point 1. – we are setting flexible_shipping_info in COD gateway settings, and we cannot set the correct shipping method.

    Working solution for me was deregister flexible_shipping_info method and then we can use correct shipping method in COD settings.

    First of all i think you should not register new shipping method only to display options page – there are other ways to achieve it,
    Second thing is that you should consider change the title of this helper shipping_method_info.

    I just wanted to inform you about the problem and solution i found ??
    Its up to you if you want to fix the problem.

    Greetings ??

    • This topic was modified 6 years, 3 months ago by Bazan.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Dear @bazan

    We have a simple custom solution for this. Please contact us here for more information: https://www.wpdesk.net/contact/

    Hello, same for me.

    Why don’t you publish the solution here?

    This is a premium solution. Unfortunately this forum is dedicated to free version only.

    Please contact us here for more info: https://www.wpdesk.net/contact/

    Thread Starter Bazan

    (@bazan)

    Lol, fix name conflict – which is an obvious bug – is not a premium solution.

    Luzinis, just put this code somewhere in functions.php of your theme:

    
    add_filter( 'woocommerce_shipping_methods', 'fix_cod_gateways_with_flexible_shipping', 11 );
    function fix_cod_gateways_with_flexible_shipping($methods) {
        unset($methods['flexible_shipping_info']);
        return $methods;
    }
    

    make sure PHP mode is open there. Don’t do that via wordpress theme editor in admin panel, but via code editor, of course check it on localhost first.

    • This reply was modified 5 years, 11 months ago by Bazan.
    Plugin Author Piotr Jablonowski

    (@jablonowski)

    Hi Bazan,

    thank you for reporting the thread. You’ve dropped the idea where the problem is.

    Responding to your comments: we fixed this by changing shipping methods creation order.

    We have released the Flexible Shipping upgrade to version 3.1. Now Flexible Shipping will be available for COD as a method for each of the shipping zones separately.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cash on Delivery payment method not working with flexible shipping methods’ is closed to new replies.