• Resolved zsebacsi

    (@zsebacsi)


    hi
    recently I’ve noticed, that the COD payment method is not working on my shop.
    I’m using Flexible Shipping – latest version, all settings are fine. COD enabled globally, flexible shipping method is enabled for this payment gw.

    I’m using 2 carriers within F.S..

    when debugging it turned out, that the condition, when it tries to check, if COD is enabled for the specified shipping method is not met.

    The strings are:
    -shipping method enabled in settings: flexible_shipping
    -shipping method chosen in cart: flexible_shipping_6_1

    can you help me with this issue?
    all WP and WC installations are up to date.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hello,

    Please, try to create new shipping method using Flexible Shipping. Name it Cash On Delivery and turn off your current Cash On Delivery shipping method.

    Plugin Author Piotr Jablonowski

    (@jablonowski)

    Hi,

    I have come to this problem and perhaps this is a bug. I need some more information from you.

    What version of WooCommerce do you have, 3.0.9 or 3.1? We have not updated Flexible Shipping to WooCommerce 3.1 yet so it may be a problem with this version.

    Can you attach a screenshot of the COD configuration?

    What you mean by writing “..if COD is enabled for the specified shipping method is not met”? Maybe write something more or attach a screen.

    AFTER UPDATE Word press to 4.8
    +
    WooCommerce 3.1.0

    The Flexible shipping not working if i select this option to be visible on COD payment only

    Thread Starter zsebacsi

    (@zsebacsi)

    ospiotr
    that was my first thought, tried it, not working.

    Thread Starter zsebacsi

    (@zsebacsi)

    WC> 3.1.0
    picture / in Hungarian, sorry.

    screenshot

    WC 3.1.0 too
    screenshot

    ScreenShot

    • This reply was modified 7 years, 8 months ago by conan206.
    Plugin Author Piotr Jablonowski

    (@jablonowski)

    Thank you for the screenshots and the Woo version.

    As I wrote we have not updated Flexible Shipping to WooCommerce 3.1 yet. We are working on it so the next week should see an update. I will inform you when the update will be available.

    Thread Starter zsebacsi

    (@zsebacsi)

    all right
    as I wrote earlier, the root of the problem -imho- is in the checking routine of WC
    it gets some kind of subversion of the shipping method (flexible_shipping_6_1, …_6_2)
    that is not equal to the string compared (flexible_shipping)
    hope it helps you

    T.

    • This reply was modified 7 years, 8 months ago by zsebacsi.

    Problem is now solved.

    zsebacsi , please update the plugin to the newest version.

    Thread Starter zsebacsi

    (@zsebacsi)

    hi
    sorry for late reply.
    it was working until today, when I upgraded to the latest version of Woocommerce 3.1.2

    now the sympthoms are the same: no COD option available, because in
    wp-content/plugins/woocommerce/includes/gateways/cod/class-wc-gateway-cod.php

    the comparison condition does not meet.
    this is how I modified the file on line 187:
    added shipping methods name by hand.
    foreach ( $this->enable_for_methods as $method_id ) {
    # if ( $check_method === $method_id ) {
    if ( ( $check_method === $method_id ) || ($check_method==”flexible_shipping_6_1″) || ($check_method==”flexible_shipping_6_2″)) {

    $found = true;
    break;
    }

    Hello again.

    We didn’t manage to replicate the bug on latest WooCommerce 3.1.2. Cash on delivery seems to works just fine and the problem you describe in the first post does not occur.

    Please, make sure that you are using the latest version of Flexible Shipping and clean version of WooCommerce 3.1.2. If you stil experience problems, please send us some screenshots showing the problem.

    Greetings!

    Thread Starter zsebacsi

    (@zsebacsi)

    here you go:
    in the file above I placed two print commands: just to see which strings are being compared.

    foreach ( $this->enable_for_methods as $method_id ) {
    # if ( $check_method === $method_id ) {
    print $check_method;
    print $method_id;
    if ( ( $check_method === $method_id ) || ($check_method==”flexible_shipping_6_1″) || ($check_method==”flexible_shipping_6_2″)) {

    $found = true;
    break;
    }

    see the result in the cart or the same in the checkout
    result
    $check_method is “flexible_shipping_6_1”
    while $method_id is “flexible_shipping”

    I’m using the latest version of F.S. / 1.9.7, woocommerce 3.1.2
    no custom modifications in any of them, only plugins.
    what else do you need from me to help you with this?

    Could you please give me more info about replicating the issue? I need steps to reproduce the bug in order to help you. Because there’s no way the error would show up to me in my test shop.

    Could you please try to disable all third-party plugins for a moment and set your theme to Storefront (default WooCommerce theme). We need to make sure that there is no conflict with any third-party software.

    Thread Starter zsebacsi

    (@zsebacsi)

    Meanwhile I’ve upgraded to WC 3.2.0, and it’s not working again
    however, the gateway modul is totally different
    wp-content/plugins/woocommerce/includes/gateways/cod/class-wc-gateway-cod.php

    failing row is:
    if ( 0 < count( array_diff( $chosen_shipping_methods, $this->enable_for_methods ) ) ) {
    return false;
    }

    I’ve changed false to true and flexible shipping is working again (dirty hack)

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Cash On Delivery not working’ is closed to new replies.