Hi
this isnt really a wppizza shortcoming as such from what i can see, but polylang not accounting for legacy WPML functions (polylang pretty much hijacks most/all WMPL functionality)
that said, as get_current_language() is somewhat deprecated anyway, i can probably account for that regardless.
to make sure this works as i would assume it to be , can you please do the following and let me know if this works. if so, i will simply add/change this in the next update of the wppizza plugin too.
so, do this:
in wppizza/classes/class.wppizza.wpml.php you will find (on approx line 61)
if($sitepress->get_current_language() != $sitepress->get_default_language()){
REPLACE this with
if(ICL_LANGUAGE_CODE != $sitepress->get_default_language()){
furthermore, in wppizza/classes/class.wppizza.categories.php on approx line 117 you will find
$current_language = $sitepress->get_current_language();
simply delete that line (it’s not doing anything anyway)
let me know if this works
thanks
Hi,
Thanks so much for the quick reply.
The main problem is that I can’t even log in to my WordPress admin page. I just get that error. Is there another way to access the css so I can make your suggested changes?
Thanks
you’d need login via ftp and disable the wppizza plugin (simply renaming the wppizza plugin from wppizza to -wppizza should work)
then do the edits in the files as mentioned above and renaming it back to wppizza
(i dont know what you mean by “access the css” but i assume thats a typo and you meant to say “cms”)
OK, I’m having some trouble logging into the FTP server too, but my hosting company is looking into it. I’ll try all this and let you know. Thanks!
I made the changes you suggested and I’m still getting that same error. Any other ideas?
Thanks,
Isaac
you will have to contact the authors of polylang I’m afraid
I’m only really actively supporting WPML integration and the error you are getting is from a standard WPML function (namely get_default_language() )
polylang however hijacks most WPML functions and to me this looks like they have simply forgotten to account for that particular function .
that said, if they reply to you and can suggest another *wpml* function or *wmpl* constant instead, i’d be happy to use that instead in future versions
(ps: these MUST be WPML functions/constants not anything unique to polylang)
OK cool, I’ll get in touch with them.
One more question for you: where can I edit the shopping cart widget? I need the title to by Shopping Cart instead of shoppingcart.
Thanks!
>where can I edit the shopping cart widget?
errr, have you tried appearance->widgets ?
Nope, I went through all the wp-pizza options but Widgets settings makes much more sense :). All taken care of, thanks!
Also, this is the reply I got from Polylang. I’m keeping my site single-language for simplicity’s sake, but just in case you’re curious:
“This is a bug in wppizza. This plugin uses a function without correctly checking that it exists. See: https://polylang.pro/fatal-error-call-to-a-member-function-on-a-non-object-in/”
>All taken care of, thanks!
ok
>This is a bug in wppizza….
I beg to differ on that front as it’s polylang that hijacks WPML . It’s a bit rich for them to say it’s a bug in another plugin if they are effectively altering the behaviour of WPML. adding a function_exists to every call of a function a plugin has in itself is just silly.
i had a bit of a rummage around out of curiosity and the following *MIGHT* work around what i personally consider the shortcomings of polylang rgarding WPML compatibility
so try this:
instead of using
if(ICL_LANGUAGE_CODE != $sitepress->get_default_language()){
as mentioned above try
$wpml_default_language = is_object($sitepress) ? $sitepress->get_default_language() : apply_filters('wpml_default_language', '');
if(ICL_LANGUAGE_CODE != $wpml_default_language){
this might just work – let me know…
-
This reply was modified 8 years, 7 months ago by
ollybach.
ok, thanks for trying though
was worth a shot at least
Hi Oliver,
Thanks again for developing this great plugin.
I’ve the same fatal error since my last update, and I also installed Polylang on my website. Did you find the solution to fix this error?
Thanks.
Helen
there is no solution
polylang won’t work with wppizza as polylang isnt WPML cpmpatible
they even know about this
https://polylang.pro/fatal-error-call-to-a-member-function-on-a-non-object-in/