Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client experienced a conflict between the WooCommerce Multilingual plugin and WC Memberships, which broke the checkout process. Specifically, adding products to the cart was failing, showing an 'Empty Cart' message unless certain plugins were disabled.
Solution:
We recommended implementing a custom code fix. Here are the steps:
1. Navigate to WP-admin → Plugins → Plugin File Editor.
2. Open the WooCommerce Multilingual & Multicurrency plugin.
3. Go to the folder: compatibility → WcMemberships.
4. Open the file: class-wcml-wc-memberships.php.
5. Scroll to line 147 which contains: return $result;.
6. Place the cursor on line 146 and add the following code:

// Workaround for Fully Being<br />if (empty($result)) {<br />    return $object_ids;<br />}

7. Click on Save.
This adjustment is a temporary workaround. We also suggested checking the errata documentation for WooCommerce Memberships restrict content conditions at https://wpml.org/errata/woocommerce-memberships-restrict-content-conditions-applies-to-all-pages-across-the-site/ for related issues.

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, please open a new support ticket. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, visit our support forum at https://wpml.org/forums/.

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.

This topic contains 37 replies, has 2 voices.

Last updated by Bobby 5 months ago.

Assisted by: Bobby.

Author Posts
June 11, 2024 at 8:45 pm #15729003

spaffordA

Hi Bobby, let me play around with this and get back to you. Thank you!

June 11, 2024 at 9:57 pm #15729055

spaffordA

Hi Bobby, I need to update the FTP credentials, as the ones I gave you earlier were for the LIVE site!! We found WP error codes populating the live site (my error!) but we disabled in the WP config file. I also saw that WPML was deactivated. I am not sure if any other changes were made, but BTW, you have access to both the Live and Staging sites with the credentials I gave you. I need to give you FTP credentials for the Staging site. Dang, that was a big mistake on my part!! Sorry!!

I RECLONED THE LIVE SITE ONTO THE STAGING SITE.

hidden link

When WC Multilingual is NOT active, the following link adds a product to the cart:

hidden link

When WC Multilingual IS active, this link does Not add anything into the cart.

I am sure you have a better sense of where issues might be, but I will turn it over to you now?

Can you activate credentials and I will send you FTP for the staging environment?

Thank you!

June 12, 2024 at 6:49 pm #15733301

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Oh no! I felt this might have been the case so nothing major was changed or done other than deactivating.

Surprisingly it said staging when I was logged in the FTP.

I have re-enabled the private reply.

June 13, 2024 at 1:43 pm #15736615

spaffordA

Hey Bobby, we just noticed that the Spanish product that we are referencing in our link does not have attributes or variations as required. I don't know that this is related to the WC multilingual program disabling 'add to cart' in the English version, but in any case we will be adding attributes and variations to the Spanish version. Just wanted to give you a heads up. Thanks!

June 14, 2024 at 6:35 pm #15741131

spaffordA

Hi again,

We fixed the issue mentioned above - we were able to add attributes and variations to a Spanish version of a product.

The problem still persists however, that the direct link to purchase does not work when the Woocommerce Multilingual plugin is activated. The cart is empty.

hidden link

Still waiting to see if you might have a fix for this.

Thanks!

June 14, 2024 at 8:25 pm #15741206

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you. It works as expected for me now.

I added the workaround mentioned here:
https://wpml.org/errata/woocommerce-memberships-restrict-content-conditions-applies-to-all-pages-across-the-site/

No fatal error logged and it is working OK.

Let me know your results, please.

Screen Shot 2024-06-14 at 1.24.39 PM.png
Screen Shot 2024-06-14 at 1.24.01 PM.png
June 14, 2024 at 8:34 pm #15741244

spaffordA

Fantastic - seems to be working for me too. Let me check in with our team before closing this ticket. Thank you!

June 17, 2024 at 8:46 pm #15746884

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Sounds good, let us know your results