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, 1 week ago.

Assisted by: Bobby.

Author Posts
May 30, 2024 at 7:02 pm #15689833

Bobby
Supporter

Languages: English (English )

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

Hi there,

I just tested this again in an incognito window as well as a different browser not used before (Safari on Macbook), and both the staging site and live site worked OK.

I get redirected to the checkout with a $15 monthly plan added.

Screen Shot 2024-05-30 at 12.01.35 PM.png
Screen Shot 2024-05-30 at 12.00.09 PM.png
Screen Shot 2024-05-30 at 12.00.04 PM.png
June 3, 2024 at 8:09 am #15696695

spaffordA

Hi Bobby,

I’ve been testing this further. At first glance, it looks like something is added to the cart when you visit the link you mention.

But the actual situation is this (using a regular subscriber account):
• Sandbox website
o Checkout works.
o Website has only Woo and WPML related plugins installed and activated.
• Staging website
o Woo & WPML-related plugins active, but Woo Multilanguage disabled
o When I visit the link (hidden link), the cart seems to be working.
o When I add a “standard” Woo product to the cart myself (“Grounded body course”), it’s working.
o When I activate LearnDash and Elementor (necessary to get to the Join page and purchase a subscription) and try and purchase a monthly subscription, it’s working.
o Then I enable Woo Multilanguage
o Now I cannot purchase a subscription anymore. The cart is empty. “Sorry, this product cannot be purchased”.
o Now I cannot purchase a “normal” product anymore. “This product can only be purchased by members”.

Perhaps you tested on the staging environment with Woo Multilanguage disabled? Can you test it again?

June 3, 2024 at 8:47 pm #15699348

Bobby
Supporter

Languages: English (English )

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

Thank you for the detailed explanation.

I was able to reproduce the issue.

You can see my explanation here:
hidden link

1. In an incognito window go to hidden link and click on either option, I use membership as an example

2. You will get no product in the cart and error

3. Now try to view the product with it's direct URL
hidden link

You will get an error that tells us that we cannot view this product without an account, causing the issue you are experiencing. Since we are not logged in with an account/member we can't purchase, thus the product is removed from the cart.

4. Deactivate WCML ===> Try again and it works OK.

What I am having a hard time understanding is how does WCML control the ability to limit the purchase of the product to members only.

Is there any configuration you can think of that would be causing this behavior?

June 3, 2024 at 8:48 pm #15699349

Bobby
Supporter

Languages: English (English )

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

The only possible related case would be the one we discussed earlier https://wpml.org/errata/woocommerce-memberships-restrict-content-conditions-applies-to-all-pages-across-the-site/

however, you mentioned that this did not help.

Please let me know if you can think of any specific settings that might be causing this, otherwise I will escalate with our team for further review.

June 3, 2024 at 8:57 pm #15699353

Bobby
Supporter

Languages: English (English )

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

Update: I tested this workaround from our errata documentation and it resolved the issue you are experiencing.

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

June 5, 2024 at 9:16 am #15705933

spaffordA

Hi,
I implemented the workaround on the test environment, and it seemed to be okay: an order in both English and Spanish carries through to a normal checkout page.

Then I implemented the workaround on the live site. Then the result is different:
- On the English side of the site, I can place any order and the checkout works as it should
- On the Spanish side of the site, I can place an order for the free minicourse without problems. But when I select a paid subscription (monthly or annually, no difference), I get a critical error.

June 5, 2024 at 5:50 pm #15708463

Bobby
Supporter

Languages: English (English )

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

Would you mind sharing the fatal error with me?

Also, is the live site different from the staging in any way? Maybe you could sync them and we can try to reproduce the error in order to fix.

June 7, 2024 at 9:30 am #15714416

spaffordA

Hi,
I uploaded the critical error. But it will not help you much I think, generic error.

The staging site was supposed to be equal to the live site. I will see if I can arrange a new clone of the live site, and let you know.

I also checked the debug log. It's a continuous list of deprecation warnings. Here is the last bit:

[07-Jun-2024 09:25:52 UTC] PHP Deprecated: Creation of dynamic property Codelight\GDPR\Modules\WooCommerceGdpr\WooCommerceGdpr::$dataSubjectManager is deprecated in /nas/content/live/fullybeing/wp-content/plugins/gdpr-framework/src/Modules/WooCommerceGdpr/WooCommerceGdpr.php on line 14
[07-Jun-2024 09:25:52 UTC] PHP Deprecated: Creation of dynamic property Codelight\GDPR\Modules\WooCommerceGdpr\WooCommerceGdpr::$consentManager is deprecated in /nas/content/live/fullybeing/wp-content/plugins/gdpr-framework/src/Modules/WooCommerceGdpr/WooCommerceGdpr.php on line 15
[07-Jun-2024 09:25:52 UTC] PHP Deprecated: Creation of dynamic property FUE_Addon_Woocommerce::$wc_conditions is deprecated in /nas/content/live/fullybeing/wp-content/plugins/woocommerce-follow-up-emails/includes/addons/class-fue-addon-woocommerce.php on line 70
[07-Jun-2024 09:25:52 UTC] PHP Deprecated: Creation of dynamic property FUE_Addon_Twitter::$twitter_admin is deprecated in /nas/content/live/fullybeing/wp-content/plugins/woocommerce-follow-up-emails/includes/addons/class-fue-addon-twitter.php on line 38
[07-Jun-2024 09:25:52 UTC] PHP Deprecated: Creation of dynamic property FUE_Addon_Twitter_Tweeter::$fue_twitter is deprecated in /nas/content/live/fullybeing/wp-content/plugins/woocommerce-follow-up-emails/includes/addons/twitter/class-fue-addon-twitter-tweeter.php on line 15
[07-Jun-2024 09:25:52 UTC] PHP Deprecated: Creation of dynamic property FUE_Addon_Twitter::$twitter_tweet is deprecated in /nas/content/live/fullybeing/wp-content/plugins/woocommerce-follow-up-emails/includes/addons/class-fue-addon-twitter.php on line 41
[07-Jun-2024 09:25:52 UTC] PHP Deprecated: Creation of dynamic property FUE_Addon_Twitter::$twitter_frontend is deprecated in /nas/content/live/fullybeing/wp-content/plugins/woocommerce-follow-up-emails/includes/addons/class-fue-addon-twitter.php on line 42
[07-Jun-2024 09:25:52 UTC] PHP Deprecated: Creation of dynamic property FUE_Addon_Twitter::$twitter_scheduler is deprecated in /nas/content/live/fullybeing/wp-content/plugins/woocommerce-follow-up-emails/includes/addons/class-fue-addon-twitter.php on line 43
[07-Jun-2024 09:25:54 UTC] PHP Deprecated: Creation of dynamic property Tangible\Updater\EDDPluginUpdater::$plugin_file is deprecated in /nas/content/live/fullybeing/wp-content/plugins/memberdash/vendor/tangible/plugin-framework/updater/edd-plugin-updater/EDDPluginUpdater.php on line 47
[07-Jun-2024 09:25:54 UTC] PHP Deprecated: Creation of dynamic property Tangible\Updater\EDDPluginUpdater::$beta is deprecated in /nas/content/live/fullybeing/wp-content/plugins/memberdash/vendor/tangible/plugin-framework/updater/edd-plugin-updater/EDDPluginUpdater.php on line 50

screenshot-fully-being-critical-error-spanish-checkout.jpg
June 7, 2024 at 10:08 pm #15717877

Bobby
Supporter

Languages: English (English )

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

Thank you.

The errors shared above point to memberdash, I do not see anything related to WPML.

Please update me if you can re-create a staging clone and I will re-add the code workaround.

June 7, 2024 at 10:26 pm #15717883

spaffordA

Thanks for this update ... I just updated plugins on the live site, and cloned to stagingfully.wpengine.com. All of the plugins are still active, but of course we can deactivate as needed.

I probably erased your credentials when I created the clone. Can you remind me how to send you new credentials?

June 7, 2024 at 10:30 pm #15717885

Bobby
Supporter

Languages: English (English )

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

I have enabled the private field reply to share those again with me.

Thank you!

June 10, 2024 at 6:41 pm #15723665

Bobby
Supporter

Languages: English (English )

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

Thank you, is this staging copy using the workaround already?

When I visit the site -> join -> add to cart it works OK.

June 10, 2024 at 7:35 pm #15723776

Bobby
Supporter

Languages: English (English )

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

Update, I reproduced the critical error, may I please have the FTP access so I can directly work on resolving this.

June 11, 2024 at 5:52 pm #15728538

Bobby
Supporter

Languages: English (English )

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

It looks like either the username or password is not working.

Please test them and let me know your results, as I keep getting an error during my attempts.

June 11, 2024 at 6:50 pm #15728766

Bobby
Supporter

Languages: English (English )

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

Thank you I was able to login, however, deactivating the plugin does not resolve the issue.

Please review the wp-config.php and .htaccess files is everything OK ?