Post by nightwing » Fri Feb 07, 2020 3:00 am

Hey Team,

I am working with a payment gateway who offers separate accounts per currency. This means the website must be coded with two separate extensions to accommodate each. This is a bit difficult as the way it's set up now, the customer chooses the currency of their card.

Is there any way to show the payment option based on the store currency selected? For example, if the store is in USD, when the customer goes to checkout, the USD Payment Module will be available, and if the customer selects GBP as their preferred currency, the GBP module is shown only.
This should still allow Store Credit (Free checkout) to be used as well.
I am not sure if JQuery could be used...

The version of OC is 3.0.3.2, Default Theme, Clean Install.
Thanks in advance for your help.
Last edited by nightwing on Thu Feb 13, 2020 11:23 am, edited 1 time in total.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by thekrotek » Fri Feb 07, 2020 3:16 am

The most valid way is to add a check right in controller/checkout/payment_method.php file somewhere below this line:

if ($this->config->get('payment_' . $result['code'] . '_status')) {

Just check if current $result['code'] (for example, bank_transfer) is allowed for selected currency (config_currency_id) and add "continue", if it's not. You only need to know the payment method codes and currency IDs.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by nightwing » Fri Feb 07, 2020 3:46 am

Thank thekrotek, I am not sure how to implement that 100%. Do you have any step by step process in mind?

Thanks
thekrotek wrote:
Fri Feb 07, 2020 3:16 am
The most valid way is to add a check right in controller/checkout/payment_method.php file somewhere below this line:

if ($this->config->get('payment_' . $result['code'] . '_status')) {

Just check if current $result['code'] (for example, bank_transfer) is allowed for selected currency (config_currency_id) and add "continue", if it's not. You only need to know the payment method codes and currency IDs.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by nightwing » Fri Feb 07, 2020 3:49 am

Also thekrotek, is it possible for when the card currency is selected, to select the currency above and refresh the page? And bring them back to Step 5 in the checkout process, skipping billing info? This would be an alternative to the above.
thekrotek wrote:
Fri Feb 07, 2020 3:16 am
The most valid way is to add a check right in controller/checkout/payment_method.php file somewhere below this line:

if ($this->config->get('payment_' . $result['code'] . '_status')) {

Just check if current $result['code'] (for example, bank_transfer) is allowed for selected currency (config_currency_id) and add "continue", if it's not. You only need to know the payment method codes and currency IDs.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by Johnathan » Fri Feb 07, 2020 10:55 pm

If you have two separate payment extensions, Restrict Payment Methods can restrict them by currency. The checkout would then only show the appropriate payment method based on the customer's currency selection.

Feel free to take a look at the screenshots and demo site, and if you're interested let me know at www.getclearthinking.com/contact if you have any further questions.

For your other question: most payment methods don't have a currency selection in their actual card entry form, so if yours does, I'd recommend hiding that to avoid confusion. If you really want to hook it into the OpenCart currency cookie you could, but you'd need a custom edit to do that. That's probably beyond what someone can help you with in the forum, since it would involve modifying the code of the payment method. Try contacting its developer and see if they can assist, and if not, you can post a request in the OpenCart "Commercial Support" forum (viewforum.php?f=88), which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area (https://www.opencart.com/index.php?rout ... er/partner).

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by nightwing » Thu Feb 13, 2020 11:23 am

Thanks Jonathan - I have worked with our payment processor's developer, he recommended the same thing... We were able to pull it off and it is now working... Thank you though!
Johnathan wrote:
Fri Feb 07, 2020 10:55 pm
If you have two separate payment extensions, Restrict Payment Methods can restrict them by currency. The checkout would then only show the appropriate payment method based on the customer's currency selection.

Feel free to take a look at the screenshots and demo site, and if you're interested let me know at www.getclearthinking.com/contact if you have any further questions.

For your other question: most payment methods don't have a currency selection in their actual card entry form, so if yours does, I'd recommend hiding that to avoid confusion. If you really want to hook it into the OpenCart currency cookie you could, but you'd need a custom edit to do that. That's probably beyond what someone can help you with in the forum, since it would involve modifying the code of the payment method. Try contacting its developer and see if they can assist, and if not, you can post a request in the OpenCart "Commercial Support" forum (viewforum.php?f=88), which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area (https://www.opencart.com/index.php?rout ... er/partner).

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm

Who is online

Users browsing this forum: dparakhiya, Google [Bot] and 422 guests