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.

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

Problem:
I am trying to restrict the payment methods for a purchase in a WC shop, in the second languages. But the tab "Payments" is not available in a WC product in the second languages with WooCommerce Payment Gateway per Product.

Solution:
- Open your file /wp-content/plugins/woocommerce-product-payments/include/payment.php
- Look for the line 114.
- Add the following:

$item['product_id'] = apply_filters( 'wpml_object_id', $item['product_id'], 'product', true, apply_filters( 'wpml_default_language', NULL ) );

This topic contains 23 replies, has 2 voices.

Last updated by Andrés 3 weeks, 6 days ago.

Assigned support staff: Andrés.

Author Posts
October 15, 2019 at 7:36 am #4755057

stefanA-12

Hello WPML Team! 🙂

I am trying to restrict the payment methods for a purchase in a WC shop, in the second languages. But the tab "Payments" is not available in a WC product in the second languages.

Link to a page where the issue can be seen: It needs to go to the admin dashboard to a WC product. Append a screenshot for that issue.

This feature to restrict the payments product is from following plugin: WooCommerce Payment Gateway per Product

This plugin is possible to translate by WPML, it´s what they write on their website. But I not need the translation, I need that the restriction of the payments methods is function. So for that it needs to be the tab "Payments" in the second languages.

Generally it needs only to copy this feature to the second languages, so that in the purchase process in the second languages are only the restricted payment methods are available.

Please, have a look to that issue.

Thank you,

Stefan

October 17, 2019 at 5:27 am #4770291

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

Hello Stefan,

Welcome to WPML support forum.

Your plugin WooCommerce Payment Gateway per Product is not in our compatibility list, however it doesn't necessarily imply that it is not compatible, just that our team has not tested yet.
https://wpml.org/documentation/theme-compatibility/

On the other hand, WooCommerce Multilingual works as a unique shop and I'm not sure if what you are looking for is possible with it. I mean, per design, WCML handles the same rules for products in all languages.

However, let's check the following. It seems that the "Payments" block is a category.
- Go to WPML > Settings > Post Types Translation
- Select your Taxonomy "Payments"
o Translatable - only show translated items
Do you see it know?

Documentation:
https://wpml.org/2018/01/wpml-3-9-released/

Best regards,
Andrés

October 17, 2019 at 9:21 am #4771553

stefanA-12

Hi Andrés,

thank you for your informations! 🙂

In Post Types Translation "Payments" is not available. So I cannot change there nothing! 🙁

I noticed if I buy a subscription/product not in the WC shop, instead of that I use the purchase possibility from my theme (I choose a subscription - then this is in the WC cart - and then on the WC checkout page, now the restriction of the payment methods is function well.

So the plugin "WooCommerce Payment Gateway per Product" is function well with a purchase process of my theme, only with a purchase directly in the WC shop the restriction of a payment method not function.

Append a screenshot to show that it function. It shows only the Stripe payment method and not the bank transfer method. So this is right with the product "Flat.Tips Startup 1".

How it is possible to fix that problem in the WC shop?

Regards, Stefan

October 17, 2019 at 1:02 pm #4773851

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

Thanks for your description, Stefan. It seems that your plugin is not compatible and we need to work with the plugin author and make it multilingual ready.

I have created a test website with a clean WordPress install. You can access it through this link:
hidden link

Please upload your plugin WooCommerce Payment Gateway per Product to this test install and setup it the same way as in your website. In this way we can check if this is a compatibility issue.


Please note that we only need the plugin and the related functionality, you don't need to setup a entire website or clone your existing site.

October 17, 2019 at 4:43 pm #4776041

stefanA-12

Hi Andrés,

I have installed my theme and some plugins to check it now on the test website from you. The result is the same as on my website.

1. You can login as a user with any user role available with registration on the frontend of the website.

2. Then you can go to the shop and execute a purchase with a second language.

Please, go to the checkout page in the shop. I have choosed the product names with payment methods which should be visible in the checkout process. To understand it more quickly! 😉

There you will see this not function in a second language, but in the default language all is o.k.!

Regards, Stefan

October 18, 2019 at 5:07 am #4778615

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

Thank you for your help, Stefan. However, the idea of this exercise is to analyze the behavior of WPML with only your problematic plugin WooCommerce Payment Gateway. Are your theme and all of those extensions necessary ? If this is not the case, I would recommend to create a new test site with only the needed extension, in that way I will be able to escalate your issue without problems to our Compatibility team.

However, for not making lost your time as you have already migrated your site, could you please tell me the exact place where you can select which Payments are available? At this moment, I can't find the payment section from your first reply.

Thank you for your help.

October 18, 2019 at 7:05 am #4778853

stefanA-12

Hello Andrés,

against thank you for your infos! 🙂

On my website I not sell products, I offer subscriptions from a membership system of my theme. This is all a little bit tricky. 😉 Anyway, only woocommerce with the plugin WC Payment Gateway Per Product should be function too. So if that better for you, create a new test site and I will install only this plugin, nothing more.

To select the payment options this is in every WC product in the admin dashboard possible. Append a screenshot to that.

A purchaser will see the appropriate payment methods on the WC checkout page.

For further questions I am at your disposal.

Reg., Stefan

October 18, 2019 at 8:47 am #4779511

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

Thanks again, Stefan, however it may not be necessary. Checking this test site I think I have found the responsible field. It is not a category but a custom field.

Could you please scroll down on your product's page and set the custom field sd_payments as Translate. Could you please check if this solves your issue?

You may need to refresh your product and translation.

Regards

October 18, 2019 at 9:52 am #4780267

stefanA-12

Hi Andrés,

I tried a lot, to resave the products and the translations, but to change the field sd_payments to Translate or to Copy, sorry that not helps. 🙁

Reg., Stefan

October 18, 2019 at 10:03 am #4780449

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

Just to be sure I understand correctly, does it work in our test site, Stefan?

October 18, 2019 at 10:53 am #4780929

stefanA-12

Hi Andrés,

now I tried a lot on the test site.

If the field sd_payments on Translate, then in the default language the payment restriction not function too! 🙁

If I change it to Don´t Translate against, then the default language is function well. 🙂

But in the second language it is not function, anyway in the status Translate or Don´t Translate.

I want to remember, if I start to purchase a subscription in the membership system of my theme, so not directly in the WC shop, then all function well with the payment restriction, also in the second languages.

Append some screenshots.

Reg., Stefan

October 18, 2019 at 11:07 am #4781105

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

Now I'm getting confuse about the difference between the subscription method and WooCommerce. 🙂

For simplifying the problem I would like to try only with your plugin. Let's try again on this new test site only with WooCommerce Payment Gateway per Product:
hidden link

Regards

October 18, 2019 at 1:41 pm #4782885

stefanA-12

Hi Andrés,

now on the new test site I have installed only the plugin "WooCommerce Payment Gateway per Product", nothing more.

I tried it with the configuration of the field sd_payment with Don´t translate and with Translate.

But in the second language a restriction of a payment method is not possible. 🙁

Screenshot append.

Hint: To start a purchase from my theme membership with the plugin "WooCommerce Payment Gateway per Product" I have not any problem. Append in the screenshot some infos to that. This I tell you only to inform you, that it should possible in any way to use the plugin.

Reg., St.

October 18, 2019 at 2:26 pm #4783319

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

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

Thank you for your help, Stefan.

To ensure that this plugin is made compatible with WPML we need to contact the author and work with him on resolving the issue.

Could you please provide a link to your plugin’s download ( or purchase) page as well as contact information (email?) to the author so we can contact them?

Regards

October 18, 2019 at 3:06 pm #4783821

stefanA-12

Hello Andrés,

here is the webpage with a free support contact form:

hidden link

The download is possible from the WP plugin directory in every admin dashboard: Plugins - Add New - Search Plugins: WooCommerce Payment Gateway per Product

Great, if you will contact them to fix this issue! 🙂

Have a nice weekend,

Stefan