WPML Problem

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #42290
    Maurizio
    Participant

      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.log

      The 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 OK

      https://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 OK

      The 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 192

      Thanks you for your help.

      #42291
      Olly
      Admin & Mod

        I’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

        #42292
        Olly
        Admin & Mod

          looking 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 a Undefined 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 course

          #42293
          Maurizio
          Participant

            ok, 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.
            Maurizio

            #42294
            Olly
            Admin & Mod
              This reply has been marked as private.
              #42296
              Maurizio
              Participant

                All categories have been translated.
                I am looking at the various options of WPML and I do tests.

                #42297
                Olly
                Admin & Mod
                  This reply has been marked as private.
                  #42295
                  Maurizio
                  Participant
                    This reply has been marked as private.
                    #42299
                    Maurizio
                    Participant
                      This reply has been marked as private.
                      #42300
                      Olly
                      Admin & Mod
                        This reply has been marked as private.
                        #42303
                        Olly
                        Admin & Mod

                          although 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)

                          #42304
                          Olly
                          Admin & Mod

                            as 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)

                            #42305
                            Maurizio
                            Participant

                              Thanks 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

                            Viewing 13 posts - 1 through 13 (of 13 total)
                            • The topic ‘WPML Problem’ is closed to new replies.