Hi Chris,
Just did a quick check with latest woocommerce 2.2.8, but everything works as expected. The only error source I can imagine would be some 3rd party code, messing around with the WC options handling.
Do you have any other plugin installed, that affects the woocommerce payment options? Do you use the default woocommerce payment gateways, or is some 3rd party component in use?
regards,
jörn
Hi Jörn!
Thank you for the fast answer!
There are quite a few plugins installed, but nothing “extraordinary”.
View post on imgur.com
I recently added WPML and all the sub-plugins needed for WPML and Woocommerce. Could that have something to do with it?
Why does the form look ok sometimes after the first save, but after a reload shows a blank form again?
Best Regards!
Chris
Okay, I found the bad guy.
It is the WPML String translation plugin. For some reason this nasty little fellow is filtering all and every option recieved from the WP options table. Additionally it is implementing a cache mechanism, which sometimes results in the pay for payment options not being showed.
Luckily I was able to omit the caching with only a few lines of code
(will fix it for the WooCommerce default payment methods).
1. Download it from here:
https://gist.github.com/mcguffin/2d30eac6a0b79e457898
2. Unpack the tar.gz archive.
3. Re-pack it as a zip file
4. Either move the php file to wp-content/mu-plugins/ or install it just like a regular plugin.
Hope it works for you,
regards, jörn
Perfect! Great support! It works again.
I sent you a small donation with paypal.
I added the filter to my functions.php, which seems to work as well.
I guess I can remove that code after the next update of the plugin?
Best Regards!
Chris
Wow, Thanks! Really Appreciated, It’s guys like you that keep me rocking!
Yes for sure, it works in the functions.php as well. But I’d rather recommend to take the plugin or mu-plugin way, because it would vanish when you upgrade your theme the next time.
I will not include these few lines in the next update. It is more like a quick and dirty workaround, than a real fix. Surely, good enough to make things work again, but not good enough to be included in an open source product that is supposed to sustain another couple of years. My general approach is to keep the codebase as lean and as maintainable as possible, and to handle plugin-interdependencies and individual use cases (like WPML or 3rd party payment gateways) somewhere else.
From my point of view, the main problem is located somewhere within WPML String Translator. It’s seems to be their cache mechanism that delivers different data than the one found in the settings. If I find the time, I will send them a bug report, hoping to come to a more sustainable solution in the future.
Have a nice Week! (closing now)
Jörn
P.S.: You should really take down the screenshot you sent like 2 posts before. It looks like there’s some information disclosed, that better should remain a secret.
Good morning!
I am facing the same problem described in this thread. Could you pls help me with instructions how to resolve it. I cannot understand what exactly I have to do…
Thanks in advance,
Penelope
Oops, I just noticed the Gist download only provides some clumsy gistfile.txt file…
Here is a proper Github Repostitory with instructions:
https://github.com/mcguffin/woocommerce-pay4pay-wpml-fix
Best regards and have a nice day,
j.
Hi!
Perfect! Now it works!!!
Thank you so much for your help.
Have a nice day!
Penelope