• My website is https://www.amerfoot.gr. I am using Storefront Theme and recently updated to latest version of WooCommerce 3.0.4. Prior to updating WooCommerce version your Plugin seemed to be working fine, however, we didn’t have a chance to do a test transaction. Now after the WooCommerce update, your Plugin is causing a problem and is throwing a message on the top of the website about a an incorrect payment_method call. When I deactivate your plugin the message goes away. I have left it on so you can see it. I also posted the message below. According to WooCommerce support, it is a compatibility issue with their latest version that they released and that you will have to update your plugin or find a quick fix to the problem. I will wait for your response.

    MESSAGE:
    Notice: payment_method was called incorrectly. Order properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), wp, WP->main, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, em_vivapayments_message, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong Please see Debugging in WordPress for more information. (This message was added in version 3.0.) in /home/amerfoot/web/amerfoot.gr/public_html/wp-includes/functions.php on line 4138

    • This topic was modified 7 years, 11 months ago by petridesal.
    • This topic was modified 7 years, 11 months ago by petridesal.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author mpbm23

    (@mpbm23)

    No updates will be provided for the latest versions of Woocommerce. You can revert to previous woocoomerce version.

    Thread Starter petridesal

    (@petridesal)

    The solution to revert to previous version of WooCommerce is not an option. Can you suggest a quick fix?… Maybe some CSS coding that could at least stop making this message show?

    By eliminating the message from showing… is there any other issues to the plugin? Does it still work properly?

    A little more info would be good.
    Thanks

    Plugin Author mpbm23

    (@mpbm23)

    Since this is a notice only and not an error you should disable debug from wp-config.php
    define( 'WP_DEBUG', false );
    And probably the plugin will be working properly.

    Thread Starter petridesal

    (@petridesal)

    Thank you. That did the trick. Notice is gone. Once we actually test the plugin will let you know if we have any problems. Hopefully we wont. Thanks again.

    I found this thread when I was looking for a solution for the same notice in my own custom plugin after the Woocommerce 3 update. For the sake of the plugin author or others looking for the answer, here is the fix.

    Search the plugin files for
    $order->payment_method

    and replace with
    $order->get_payment_method()

    I found the answer because this is the very thing Woocommerce did in their own default gateways. When I made this change to my own plugin, that took care of the notice.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Notice: payment_method was called incorrectly.’ is closed to new replies.