WPPizza – A Restaurant Plugin for WordPress › Support › General Support › WPML Problem
- AuthorPosts
- 25 March, 2019 at 4:45 pm #42290
Hi Olly,
I have a problem that I can’t solve
https://www.pizzeriacarignano.it/
WordPress 5.1.1
PHP 7.2
I have already taken steps to disable all the plugins, with the exception of Yoast Ver. 10.0.1 and WPML Multilingual CMS Ver. 4.2.4.1 WPML String Translation Ver 2.10.2 – 5 Language (I already Tested in two languages)
Debug Log:
https://www.pizzeriacarignano.it/wp-content/debug.logThe problem occurs when you add a Standard product without Ingredients to the cart.
The Italian language (main language) works regularly, but all other languages do not, the product is not added to the cart.For example:
https://www.pizzeriacarignano.it/it/ordina-online/crepes/
it is OKhttps://www.pizzeriacarignano.it/en/order-online/crepes/
does not work, none of the products is added to the cart.All the products that work with the ingredients plugin work regularly in all languages
For example:
https://www.pizzeriacarignano.it/en/order-online/white-pizza/
it is OKThe errors (of debug.log) are Always:
[25-Mar-2019 16:39:03 UTC] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /web/htdocs/www.pizzeriacarignano.it/home/wp-content/plugins/wppizza-add-ingredients/ajax/get-json.v3.php on line 269
[25-Mar-2019 16:39:08 UTC] PHP Notice: Undefined offset: 97 in /web/htdocs/www.pizzeriacarignano.it/home/wp-content/plugins/wppizza/classes/class.wppizza.categories.php on line 192
[25-Mar-2019 16:39:08 UTC] PHP Notice: Undefined offset: 96 in /web/htdocs/www.pizzeriacarignano.it/home/wp-content/plugins/wppizza/classes/class.wppizza.categories.php on line 192
[25-Mar-2019 16:39:08 UTC] PHP Notice: Undefined offset: 102 in /web/htdocs/www.pizzeriacarignano.it/home/wp-content/plugins/wppizza/classes/class.wppizza.categories.php on line 192
[25-Mar-2019 16:39:08 UTC] PHP Notice: Undefined offset: 103 in /web/htdocs/www.pizzeriacarignano.it/home/wp-content/plugins/wppizza/classes/class.wppizza.categories.php on line 192
[25-Mar-2019 16:39:08 UTC] PHP Notice: Undefined offset: 104 in /web/htdocs/www.pizzeriacarignano.it/home/wp-content/plugins/wppizza/classes/class.wppizza.categories.php on line 192
[25-Mar-2019 16:39:08 UTC] PHP Notice: Undefined offset: 105 in /web/htdocs/www.pizzeriacarignano.it/home/wp-content/plugins/wppizza/classes/class.wppizza.categories.php on line 192
[25-Mar-2019 16:39:08 UTC] PHP Notice: Undefined offset: 106 in /web/htdocs/www.pizzeriacarignano.it/home/wp-content/plugins/wppizza/classes/class.wppizza.categories.php on line 192Thanks you for your help.
25 March, 2019 at 4:56 pm #42291I’ll see if I can reproduce this here first of all
from what you are saying this would seem to be an issue with the add ingredients plugin in conjunction with WPML, which narrows it down somewhat
will get back to you when i know more, but this might take a little bit
25 March, 2019 at 5:06 pm #42292looking at your /wp-content/debug.log when (unsuccessfully) trying to add something to the cart myself here
https://www.pizzeriacarignano.it/en/order-online/crepes/
i get aUndefined offset:....../class.wppizza.categories.php on line 192
which leads me to believe it’s (perhaps – cannot be sure yet ) a non-translated category ?
can i ask you this as well please: are all categories that an item belongs to also available (and translated) for your other languages ? or maybe there’s an option in WPML that lets you enable/disable this ?
just trying to narrow things down . After all I do not know every single option available in WPML as I am not the developer of WPML of course25 March, 2019 at 5:07 pm #42293ok, Olly thanks.
If you want the permissions to enter my website and do tests, you can have the passwords whenever you want, I have all the backups.
Ciao.
Maurizio25 March, 2019 at 5:14 pm #42294This reply has been marked as private.25 March, 2019 at 7:22 pm #42296All categories have been translated.
I am looking at the various options of WPML and I do tests.25 March, 2019 at 7:33 pm #42297This reply has been marked as private.25 March, 2019 at 7:48 pm #42295This reply has been marked as private.25 March, 2019 at 7:52 pm #42299This reply has been marked as private.25 March, 2019 at 8:28 pm #42300This reply has been marked as private.25 March, 2019 at 9:11 pm #42303although there’s probably a case that can be made to perhaps do some scripting that would account for this, the fundamental problem from what i can see is as follows:
though your pages are translated , you are using the non-translated shortcode on these pages.
i.e on your IT page you are using
[wppizza category='crepes' noheader='1' showadditives='0']
which works fine, as we know
however, on the EN translation your are ALSO using[wppizza category='crepes' noheader='1' showadditives='0']
where you should be using the shortcode that references the EN categories – that is[wppizza category='crepes-en' noheader='1' showadditives='0']
(note the category slug difference)not using the associated slug will in effect result in the categories not existing for that language (in simple terms) which will throw these issues and therefore the plugin will not be able to add anything (categories are somewhat essential for all sort of things)
let me know if the above makes sense. (certainly fixes it when i do this here with your setup)
25 March, 2019 at 9:13 pm #42304as far as i remember , you can actually tell WPML to not translate categories , in which case it would also work i would expect, however , this is probably not something you want (as the category names would stay the same regardless of language)
25 March, 2019 at 9:47 pm #42305Thanks Olly, problem solved, it works correctly, I will update all the pages.
I had no thought of this solution, even though it was in front of my eyes.
Maurizio - AuthorPosts
- The topic ‘WPML Problem’ is closed to new replies.