Support » Plugin: WooCommerce - Country Based Payments » Settings have dissapeared

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ivan Paulin

    (@ivan_paulin)

    Hi,

    Can you let me know which WooCommerce plugins do you use along with this one?

    We had similar problems where the settings has disappeared because of the WooCommerce COD Advanced plugin.

    Hey,

    this is happening because WC()->payment_gateways->get_available_payment_gateways() is not ment to be used the way the plugin is using it. Some payment gateways implement custom is_available() method and, for example, expect that WC()->session or WC()->cart exists in the time of calling, otherwise they will crash with “PHP Fatal error: Call to a member function XXX() on null” leading to the problem the original poster is experiencing.

    This is the same reason why the WooCommerce in-built COD payment gateway is not listed on plugins settings page – it_available() checks if cart needs shipping or if the page requested is checkout page – which both is, of course, false, because we’re on the admin plugin settings page.

    To resolve the issue I suggest you should replace WC()->payment_gateways->get_available_payment_gateways() with WC()->payment_gateways->payment_gateways() and filter out the gateways that are not enabled.

    M1CH43LK4MP

    (@michaelhurenkamp)

    Thanks, but the issue has already been resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Settings have dissapeared’ is closed to new replies.