PAYONE-GmbH / magento-2

PAYONE Payment Extension for Magento 2
28 stars 59 forks source link

Multi-website Magento instance Base Currency / Display Currency issue #298

Closed ostukalovprovectus closed 4 years ago

ostukalovprovectus commented 4 years ago

We have a Magento instance that has multiple websites (multiple stores and store views).

When PayOne is configured, you can choose 2 options. Base Currency and Display Currency. The base currency for Magento instance is EUR.

The problem is that for each website we have different Base Currencies. E.g. for the polish website - Base Currency is PLN, but for PayOne the base currency is always EUR.

This is a very critical issue that does not allow charging money in certain store views.

fjbender commented 4 years ago

Looking at the code, we grab the respective currency from the Quote:

https://github.com/PAYONE-GmbH/magento-2/blob/ef6f688ca5122dcb84937a7a9ede517c1d4e6f44/Helper/Api.php#L303-L316

Can you tell me the plugin and Magento version you're using? I'll then try to reproduce your issue.

ostukalovprovectus commented 4 years ago

I think the concern is about $sCurrency = $oQuote->getBaseCurrencyCode();

It takes it for the whole instance (default one), not per website. I can share screenshots, or provide information in a different form. Just let me know how can I contact you.

Magento CE 2.3.3 (the same was reproduced on 2.2.2)

fjbender commented 4 years ago

Okay, as a non-Magento-person, I'd expect the Quote to give me the currency from the website it was created in, but that's just me. :)

How would the usual approach to this look? In that method, we don't really have a lot of context.

ostukalovprovectus commented 4 years ago

@fjbender,

Let me explain the issue. https://docs.magento.com/m2/ce/user_guide/stores/websites-stores-views.html

In Magento default config we have base currency = EUR. In every website (we have >5, each with different URLs), we have its own Base Currency set (which might be different to EUR).

But, in your extension, in settings we have only 2 options: Display Currency and Base currency - which is always EUR, you just take it from Global settings.

That's a clear example: 1) Globe settings - Base Currency is EUR 2) Website - Base Currency is PLN 3) Website has several store views, 3.1) with currencies setup PLN and 3.2) EUR (prices are converted from PLN in this case).

And what happened, we cannot choose Base Currency for this website (it allows only taking it from Global settings), but if we set to Display Currency, store view with EUR won't work anymore... because PayOne account is in PLN.

I hope I explained it clear.

fjbender commented 4 years ago

All right, thanks for bearing with me.

I'd need to get Dev involved here to get an assessment. I'd propose to change the selection of the "Currency" config option to something like:

Does this make sense?

ostukalovprovectus commented 4 years ago

Yes

fjbender commented 4 years ago

I have created a ticket for Dev. Please allow some time for the initial assessment.

fjbender commented 4 years ago

302 should tackle this issue. I couldn't test it yet, but maybe you already have some suggestions

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.