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

Last updated by Yvette 6 months ago.

Assigned support staff: Yvette.

Author Posts
April 11, 2019 at 8:04 pm #3592639

sladjanJ

I am trying to:
I have two languages enabled: English (default) and Serbian(secondary). I have enabled two payment methods:
-paypal = for all countries except Serbia
-cash on delivery = for Serbia only

Link to a page where the issue can be seen:
Website is "under construction" yet, can be seen only with admin permissions (I'm willing to give access)

I expected to see:
Payment methods to work properly

Instead, I got:
When the website lang is English everything is fine but when the lang is Serbian, there are no available payment method for any country except for Serbia (paypal should be enabled for other countries).

Thanks!

April 12, 2019 at 9:47 am #3597313

Yvette
Supporter

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

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

Hello

I´ll be helping you with this issue.

1. Temporary Access to your system
Please provide access to your system (wp-admin and ftp) so that I can further investigate this particular problem. The fields to provide this data are included in a private section that I will open for your next response. You can find it above the comments area. The information in this private section is only visible between WPML Support and you.

2. Please include steps with a sample product how to see the issue you describe.

Thanks!

April 12, 2019 at 1:37 pm #3599547

sladjanJ

test

April 12, 2019 at 1:41 pm #3599581

Yvette
Supporter

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

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

????

I´m opening the private area again.

April 12, 2019 at 1:45 pm #3599701

Yvette
Supporter

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

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

Curiously, I received an email from your id with system access details.
Unfortunately, when I cut&paste them into the system, they did not work.

Could you please double check the values and enter them here in the private area agin?

April 13, 2019 at 12:36 pm #3604573

sladjanJ

Hi Yvette,
I've added a FTP details to previous private message.
Thanks!

April 15, 2019 at 10:13 am #3612309

Yvette
Supporter

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

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

Hello

I was not able to replicate this issue on a test sandbox site here:
Login: hidden link

Scenario:
Payment methods: Cash and Check

Orders from Spain should only be offered option to pay in Cash.
Orders from anywhere else should only be offered option to pay with Check

Could you please login and see if you are able to setup the problem that you are encountering with your site?

Feel free to modify existing configuration but please do let me know what is changed if you manage to replicate the issue.

April 15, 2019 at 11:00 am #3612755

sladjanJ

Hi Yvette,

I'm looking at the sandbox installation and I think this has nothing to do with my issue 🙂 You have maybe answered on some other ticket or something.
The sandbox is not a duplicate of my installation, my second lang is Serbian (not Spanish), and payments methods I'm interested in are Papal and Cash on delivery.

Can you please duplicate my own installation and then try to replicate the issue?

Thanks,
Nikola

April 15, 2019 at 11:19 am #3612911

Yvette
Supporter

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

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

No - this site is intended this way.

If you believe that the you must have Serbian, then you may add it. The same thing with Paypal.

The site is set as follows so that it will not be interfering with any other theme or plugin that you might have installed on your own site. We call this a minimal setup.

If you are able to make it work on a fresh minimal setup, then we can know that perhaps the issue you are experiencing is linked to something specific to your site. But we must first rule out a problem that might be with our own code.

This is just our protocol.
If you are unable to replicate the issue, then we will look at a duplicator of your site. However, I am not sure to what extent we are continuing support on this plugin as the development for it has stopped and it is no longer available for download.

I am trying to find this out while you recreate the issue on the sandbox site

April 15, 2019 at 6:32 pm #3615791

sladjanJ

Hi, I managed to reproduce the issue on the sandbox.
Here are the steps(not sure that all this is needed but..):
-Added Serbian language instead of Spanish
-Enabled multi-currency mode
-Added "Serbian dinar" as currency
-From "Currencies" disabled euro for Serbian
-From "Currencies" disabled dinar for English
-Added Serbian translate for one product(T-Shirt with Logo)
-Added price for Serbian price manually using "Set prices in other currencies manually"
-Disabled "Check payment" payment option
-Enabled "Paypal" payment option
-In the Paypal settings for "Country availability" choose "All countries except selected" and enter "Serbia"
-In the "Cash on delivery" settings for "Country availability" choose "Only selected countries" and enter "Serbia"

I've already added the product in the cart, to see the issue:
- just go to the "Checkout" page
- Set language to be "Serbian"
-Try any other country except "Serbia"

Notes:
-Serbian is using cyrillic letter so you may not understand it easy, please just ask
-Serbian = српски
-Serbian currency is dinar (din)
-Serbian currency is not supported by Papal and I think that may be connected to this issue. But that should still work because, in my currency settings for all other countries except Serbia, euro and Paypal should be enabled.

Thanks,
Nikola

April 16, 2019 at 8:01 pm #3625331

sladjanJ

Hi again,
I think I can save you some trouble, there is an easier workaround for my issue. We can use this solution and you don't have to investigate further more.
Can you please just give me the code for doing this:
-When delivery country dropdown is changed, call a function that will do:
-If the destination country is Serbia - change cart currency to "din" (local currency)
-For any other destination country - change cart currency to "eur"

I think this would be a good workaround for the bug I'm experiencing.
Thanks!

April 17, 2019 at 4:25 pm #3632877

Yvette
Supporter

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

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

Hello

I´ve been testing this and here is what I understand from your configuration:

Scenario:
- Payment methods: Cash and Paypal
-Country availability Rules:
-- Cash = Only Serbia
-- Paypal = All countries except Serbia

THEREFORE
Orders made from Serbia should only show Cash payment option
Orders made from other countries should have only Paypal options showing

PROBLEM
This is not working in Serbian language

You wrote:
"... in my currency settings for all other countries except Serbia, euro and Paypal should be enabled."

When I checked the configuration for multicurrency, I did not see this to be the case. So I enabled Euro for Serbian (see image).

Doing this allowed for the correct Paypal option to be shown in Serbian langauge.

Can you confirm this on the sandbox site - and does the same thing happen on your own site?

April 17, 2019 at 8:02 pm #3634615

sladjanJ

Hi,

I tried the solution on sandbox but unfortunately, this is still not ok. You are missing one thing, the currency for Serbia is "din.(дин.)" only, euro is not allowed. Therefore, the solution is not really relevant 🙁 Please try with adding "din" ( дин.).

Note: Cyrillic "din" is = дин.

Thanks,
Nikola.

April 18, 2019 at 7:40 am #3636871

Yvette
Supporter

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

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

I see what you mean. If I change the country to "Serbia" in checkout, the payment method is correct (i.e. Cash on delivery) and Paypal is offered to non-Serbian billing countries when using Serbian language, but the order total remains in EURO (which is not allowed).

However, this problem is also present with the current multi-currency configuration (e.g. one currency per language) you propose. If I place an order in English and select my ""Billing Country" to be "Serbia"...the order remains in Euro with correct payment method (e.g. Cash on delivery). This is not allowed - right? Additionally, you have the issue that Paypal is not allowed for non-Serbia billing countries when using the Serbian language.

I think the issue here is that need the Gateways Country LImiter plugin to do more than it was designed to do. The plugin will only limit payment methods based on billing country. It does not limit currencies based on billing countries.
e.g. RSD for Serbian and Euro for English.

If it did, then you would have the complete solution to meet your needs.

At this point, I am not sure I can escalate this as a bug as it is really a "feature request" for a plugin that we have stopped development on.

As you pointed out - you will indeed need a custom development. Our support policy does not include custom work/solutions. I can only point you to our existing WCML hooks/API here:
https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

Of note would probably be this hook:
wcml_localize_woocommerce_on_ajax
https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/#hook-1052709

Here is a list of our WPML contractors:
https://wpml.org/contractors/

I think you requirements are quite clear as you have written them.

On the AJax change of Billing Country in the checkout page, re-total the cart using country:currency associations you have defined.