If you are having a notice about writing the .mo files please read this doc

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by Yvette 1 year ago.

Assigned support staff: Yvette.

Author Posts
March 13, 2017 at 7:56 pm #1229277

allenC-3

I am trying to: Use the new plugin I installed without problems

URL of (my) website where problem appears: mabiandco.com

I expected to see: My website as it normally looks after installing the plugin

Instead, I got:
My webpage but the following code error message on the menu

Warning: Missing argument 2 for WCML_Vpc::wcml_vpc_cart_exc() in /home/moviela2/public_html/mabiandco/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-vpc.php on line 9

Warning: Invalid argument supplied for foreach() in /home/moviela2/public_html/mabiandco/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-vpc.php on line 11
$0.00 0 items

Steps to duplicate the issue: Go to mabiandco.com

They say their plugin is compatible with WPML, this is their plugin>
hidden link

March 15, 2017 at 12:44 am #1230466

allenC-3

No response and its been over 24 hours

March 15, 2017 at 3:36 pm #1231196

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Hello.

I will be helping you with this issue. I found another report of this same error here:
https://wpml.org/forums/topic/missing-argument-2-for-wcml_vpcwcml_vpc_cart_exc-in-class-wcml-vpc-php/

I´ve checked with the main supporter on this ticket and I have been informed that this issue should be resolved with the latest release of the Visual Product Configurator plugin. Can you please confirm that you have the latest of all related plugins installed?

If this problem has resurged, it´s important that I signal this to our compatibility team.
Thanks for your news.

March 16, 2017 at 12:30 am #1231524

allenC-3

Hi, I have the latest version of the plugins and the issue is surfacing. I still need assistance.

March 16, 2017 at 7:38 am #1231635

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Ok. Thanks for checking that.

1. Additiona Diagnostics
1.1. Please confirm that this is still happening if your temporarily deactivate all non-WPML plugins and the plugin associated.

1.2. Please also confirm that the problem still exists if you temporarily change your active theme to Twenty Fourteen.

2. Have you approached the plugin author with this problem? It was a well-known issue and required code changes from their side.

3. In order that the team can investigate this problem, please create a snapshot of your system using the Duplicator plugin (free). It will create 2 files called a "package". Include a downloadable link to this file in the private area that I am opening. You should use a file sharing service like Dropbox or Fileshare.

Here is a video instruction to this
hidden link

4. Possible Workaround in the meantime
When this problem initially surfaced, it was determined that the following modification could address the issue as a workaround. It may work for you.

Find function wcml_vpc_cart_exc() located in file .. /woocommerce-multilingual/compatibility/class-wcml-vpc.php

Change the function code from this:

function wcml_vpc_cart_exc( $exc, $cart ) {

		foreach( $cart->cart_contents as $cart_item ){
			if ( array_key_exists( 'visual-product-configuration', $cart_item ) ) {
				return false;
			}
		}

		return $exc;
	}

to this

function wcml_vpc_cart_exc( $exc, $cart ) {

                 if ($cart == false) {
                    global $woocommerce;
                    $cart = $woocommerce->cart;
                }
              
		foreach( $cart->cart_contents as $cart_item ){
			if ( array_key_exists( 'visual-product-configuration', $cart_item ) ) {
				return false;
			}
		}

		return $exc;
	}

I wait to hear if this helped you and for a link to your system so I can reopen this issue with the compatibilty team and the plugin author.

Thanks

March 17, 2017 at 7:41 pm #1233487

allenC-3

Step 1: This is not happening when I deactivate the visual product configurator plugin, only when that plugin is active I am having this issue.

1.2. The problem still exists even after changing to default theme as long as the VPC is still active

Step 2: I have already approached the plugin authour and they told me to contact you.

Step 3: I dont see a private area for step three please include

Step 4 : I tried the change on the file you indicated this parially resolved the issue before the change we were seeing:
Warning: Missing argument 2 for WCML_Vpc::wcml_vpc_cart_exc() in /home/moviela2/public_html/mabiandco/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-vpc.php on line 9

Warning: Invalid argument supplied for foreach() in /home/moviela2/public_html/mabiandco/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-vpc.php on line 11
$0.00 0 items

Now we are only seeing:

Warning: Missing argument 2 for WCML_Vpc::wcml_vpc_cart_exc() in /home/moviela2/public_html/mabiandco/wp-content/plugins/woocommerce-multilingual/compatibility/class-wcml-vpc.php on line 9

March 19, 2017 at 10:08 am #1233900

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

1. I am opening the private area again for the Duplicator package.

2. Don´t forget to include system access details

3. I´d like to take a closer look as well on your system to see if I can update the "workaround" so at least you can continue working.

Thanks.

March 20, 2017 at 9:43 pm #1235164

allenC-3

hi please confirm If I can do it from the file manager by copying all files cause the duplicator is not working and kindly reopen a private access so I can send download file via there.

March 20, 2017 at 10:32 pm #1235200

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Hello.

Could you try testing it again? I noticed that the code I posted was not correct. It should have been the following:

function wcml_vpc_cart_exc( $exc, $cart = false ) {
 
                 if ($cart == false) {
                    global $woocommerce;
                    $cart = $woocommerce->cart;
                }
               
        foreach( $cart->cart_contents as $cart_item ){
            if ( array_key_exists( 'visual-product-configuration', $cart_item ) ) {
                return false;
            }
        }
 
        return $exc;
    }

}

I´ve corrected the code for you already.

March 21, 2017 at 2:36 pm #1235882

allenC-3

Thank you that did fix the issue everything is working correctly now. Isnt that the issue that had supposedly been updated? Wont the website fail again on the next update?

March 21, 2017 at 2:55 pm #1235915

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Yes.

The "correction" was supposed to have been delivered by the plugin author. This fix on our side was considered to be temporary.

1. I managed to get a snapshot of your system with the Dupliator plugin so I will be escalating this to our development team.

Could you just detail how to replicate the error? Was it simply to go to the shop and select a production into the cart?

2. My udnerstanding was that the plugin author was making changes to their code and that our changes were no longer necessary. This is why I want to escalate this to our development team so they can verify or recontact the plugin author.

Thanks for answer the questions in point 1.

March 21, 2017 at 4:08 pm #1236007

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

Escalated.

March 21, 2017 at 4:14 pm #1236010

allenC-3

Gladly to replicate the issue simply add a product to the cart and head to the cart. There you will see the warning code alongside the product totals and above the proceed to checkout button.

Ok so I should just stay on standby meanwhile correct? In how long should I be reaching out and expect a fixed solution?

Best,

October 25, 2018 at 12:51 pm #2849849

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+01:00)

This issue was resolved with 2.3.7 of Visual PRoducts Configurator