Skip Navigation

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

Problem:
When WPML is active, each product appears 16 times instead of once, and product categories are deleted when attempting to add purchasing discounts for a membership.
Solution:
1. Update the code from WooCommerce Memberships as per the instructions on https://wpml.org/errata/woocommerce-memberships-does-not-assign-membership-when-purchasing-a-product-in-a-secondary-language/.
2. Update WooCommerce Multilingual following the guide on https://wpml.org/errata/woocommerce-memberships-restrict-content-conditions-applies-to-all-pages-across-the-site/.
3. Manually adjust the membership settings in the WordPress editor after disabling the translation editor.
4. Ensure category synchronization in 'WooCommerce > WooCommerce Multilingual > Category'.

If this solution does not resolve your issue or seems outdated, we 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. If further assistance is needed, please open a new support ticket at WPML support forum.

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 16 replies, has 2 voices.

Last updated by Nicolas V. 3 weeks, 1 day ago.

Assisted by: Nicolas V..

Author Posts
October 1, 2024 at 1:45 pm #16240753

frankG-4

Background of the issue:
I try to add Purchasing Discounts for a Membership. If WPML is not active, everything is fine and it keeps the Product or Product Category. If I have WPML active, it keeps one product 16 times. As we have 4 languages, it adds the product in each language and at least 4 times. So one product is 16 times in the list instead of 1. It's even possible to add Product Categories, but the categories are deleted. Link to a page where the issue can be seen: hidden link

I was in contatct with Membersup Support and got this answer, which is not acceptable:

Zach replied
Hey there Frank,

Thank you for getting back to me on this with these details and the login credentials!

I do not think we will need the login credentials from our side at this time, but if needed, I do greatly appreciate the access. Since you have determined that the error only occurs with all the WPML plugins active, it sounds as though you have confirmed the root issue. Like I noted earlier, there is incompatibilities with the way WPML handles creating duplicate posts and categories for each language in use and it causes a wide range of issues when attempting to set up memberships.

If you want to utilize WPML, you may try reaching out to their support for additional assistance on this issue. That said, to avoid issues with the Memberships with WPML, it would be recommended to create a membership plan and product for each language and utilize unique posts for each language to avoid these types of conflicts occurring.

I am sorry that I do not have better news for you on this, but I hope you have found the information helpful nonetheless!

Best wishes,
Zach

Symptoms:
Each product appears 16 times when WPML is active. Product categories are deleted.

Questions:
Why does each product appear 16 times when WPML is active?
How can I add product categories without them being deleted?

October 1, 2024 at 3:36 pm #16241701

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

As discussed, I've created this clean sandbox setup on our servers here:
hidden link (one click login)

- Install the WooCommerce Memberships plugin and try to recreate the issue.

Please don't install any other plugins that are not necessary to reproduce the issue.

- If the issue is reproduced on that clean setup, then I can forward this to our 2nd tier support team.

October 3, 2024 at 9:24 am #16248518

frankG-4

Hi Nicolas, sorry for the delay, but there are so much more errors I have to check.

I now installed the Membership plugin and created membership plan (in German). I Translated the Product Categories and the T-Shirt Category Products. If I enter the Products in the Plan under Restrict Products they keep in the field, but (As I thought) one Product is seem 4 Times (2x2 Translation). If I try to enter a Product Category, this will be deleted after saving. Same happens in the Tab Purchasing Discount. No Product Category is taken.

One other question: When we did the chat I translated the Membership plan - as you told me. But that was wrong you told me. So I tried to delete the Translations. In Spanish and French I deleted them, but the English Translation I cannot delete. The Trash is deactivated. So I have two plans now if I switch to see all languages. The Plan with the Number-Slug I want to get rid of. But How? See Screenshot.

Bildschirmfoto 2024-10-03 um 11.22.14.png
October 3, 2024 at 8:57 pm #16252042

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for reproducing the issue. Here’s what I did:

- I updated a part of the code from WooCommerce Memberships following these instructions: https://wpml.org/errata/woocommerce-memberships-does-not-assign-membership-when-purchasing-a-product-in-a-secondary-language/

- I then made a similar update in WooCommerce Multilingual by following these instructions: https://wpml.org/errata/woocommerce-memberships-restrict-content-conditions-applies-to-all-pages-across-the-site/

- Lastly, I edited the membership plan here: hidden link and was able to successfully add the category.

Could you please confirm that everything is working correctly in both languages?

Regarding the other issue, I’m not entirely sure why WordPress is preventing you from deleting the plan. It could be related to the fact that it has members. Once you confirm that the first issue is resolved, we can take a closer look at this.

October 4, 2024 at 1:41 pm #16254552

frankG-4

Hu Nicolas, thank you for these changes. It's much better than before.

I Have problems with the translation of the plan. I clicked the + (translation Sign) in Membership Plans behind VIP Membership and Translated it. Now I can Switch Language with the Flags at the Top. I can place other Products and Product Categories in English Plan Translation than I German. During Saving of the Content I get a Message, that Translation is in Progress. I Clicked "Edit Anyway".

In German I have 3 Products (T-Shirts) and Hoodies (there are 4 in the Category - bu only one is Translated).

When I go to Shop Page, I see all Products in German and in English 4. These are the 3 Purchase Restriction Products from German Plan and because there is only 1 Transaltion of a hoodie I t´see this.

Maybe it has to do with the Problem, that The I enter one Translated Product, it will be shown 4 Times (2 x 2) When You have 4 Languages it will be 16. But the Product Category is only the single Category. All Categories are translated.

So there is still a Problem left.
Sorry, for no better News, but maybe there is another way for translation???

Best Regards, Frank

October 4, 2024 at 11:26 pm #16255909

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

I'm not sure to understand what you're trying to accomplish.
1. Do you want the same Plan in all languages (with exactly the same products, restrictions and discounts)?
2. Or do you want to have a totally different plan in English?

You can't translate the plan with te WPML editor and then use the WordPress editor to make "adjustments" on the rules.

October 5, 2024 at 7:40 am #16256124

frankG-4

Hi, I am sorry. What I need is to have the same plan in all Languages with same Products and Discounts.

But as the plan was restricted only in English, I tried to translate the plan and filled in products to see, if this will help to restrict the Products in German as well.

October 7, 2024 at 12:37 pm #16261413

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

One of the restricted product is the T-Shirt with Logo.

Please follow these steps before logging into the admin account:
- DE: hidden link
- EN: hidden link

You will see the following messages from WooCommerce Memberships:
- "This product can only be purchased by members."
- "Want a discount? Become a member!"

Now, log in using this link hidden link and refresh both pages.
After logging in, you should now be able to add the product to your cart at a discounted price.

PS: I also created a "customer" profile and installed the User Switching plugin, which will make it easier for you to switch between member and non-member users if you want to run more tests.

If I’m missing anything or if the issue persists, please record a short video using loom.com or send clear, step-by-step instructions so I can reproduce the issue on my end.

October 9, 2024 at 2:39 pm #16271100

frankG-4

Hi Nicolas.

sorry for the delay, but we brought the page with the membership online, even though we have this problem.

I just tested the sandbox and I really found one problem. I logged in as demo and translated now every product into English (I only copied every content). Now we have all Products in both languages.

Then I logged off, so I am a normal visitor. In German everything is fine, but if you switch to English the Hoodies are not blocked. The 3 Single Products are blocked, which is fine.

I tried to add the English translation to the restricted Product, Product Category, but this is not passible.

Please have a look.

October 9, 2024 at 9:05 pm #16272473

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

As a workaround, I did the following:
1. When editing the membership in DE, I switched off our translation editor in the right sidebar and selected the WordPress editor instead (hidden link).
2. I translated the membership by clicking on the "+" icon.
3. That opened the empty EN membership in the WordPress editor.
4. I manually set the EN membership restrictions to be identical as the DE one.
5. Last, in "WooCommerce > WooCommerce Multilingual > Category" I made sure to synchronize the hierarchy(hidden link).

October 10, 2024 at 2:06 pm #16275603

frankG-4

Hi Nicolas,

thats a good solution and we can go with it.

Now I have 2 Questions:

1. You did programmable changes to some plugins (Woo Membership and Woo Multilingual). How do these changes become active in our Website? It must be possible to get updates from these products...

2. Membership has a first tab RESTRICT CONTENT. We need to restrict a category form a Download Module WP FILE DOWNLOAD (hidden link). We could add a category from the plugin in restricted content, but after saving the category is lost - same as for Restricted Products before. Will this work with your changes or do we have to test it as well?

Thanks, Frank

Bildschirmfoto 2024-10-10 um 16.02.28.png
October 10, 2024 at 11:51 pm #16277188

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

1. The changes I made are listed in my answer from October, 3rd
Until those 2 erratums are marked as "Resolved" you might need to add again the code after updating the plugins.

2. I'm not familiar with this plugin. Could you please install it and reproduce the issue. Please make sure to give me clear, step by step, instructions so I can understand how it works.

October 17, 2024 at 11:42 am #16299928

frankG-4

Okay, I will test it and will give you a response, if it works or if I need assistance.

October 17, 2024 at 3:46 pm #16301334

frankG-4

Hi Nicolas, I set up WP Download Plugin and I could set a WP Download Plugin Category into the membership tab RESTRICTED CONTENT. And the Translation into the Englisch version. The Categories stay in its Tab, which is okay.

However, I could download Files from the Restricted Content Category, when I was logged off - as a normal Visitor, which is not okay. But: I have to check now, if this is really a problem because of WPML, or a problem from membership Plugin itself. I will set up an Environment without WPML. Only with Membership and WP File Download. Lets see, if it blocks the download without WPML.

Please wait for my further tests.

October 17, 2024 at 3:51 pm #16301344

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hi Frank,

Thanks for the follow up, I'll let this ticket "waiting for your feedback".

However, I could download Files from the Restricted Content Category, when I was logged off - as a normal Visitor, which is not okay.

- If the restriction works on the primary language and not on the secondary language, maybe the restriction rules are not copied into your translation.

- If the restriction doesn't work even on the primary language then it could be an issue between Membership and WP File Download as you mentioned.

Either way, I'll wait for your feedback.
Thanks,
Nico