changing Primary store currency at runtime

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
Is there a way to change the Primary store currency at runtime?

i have my store with 2 currencies usd and mxn
usd is the Primary store currency, meaning all my prices are in usd

customer can switch between currencies as desire...

i have in paypal also those to currencies availables, this mean that if my Primary store currency is usd... paypal charges usd to my customer, if have have the Primary store currency in mxn paypal charges mxn...

what i need is that if the customer checks out in usd... to tell paypal to charge usd, if the customer prefers mxn, to be able to tell paypal that...

saludos
rubenc
14 years ago
Hi!

I would like to have an answer to this too.  How can we get PayPal to integrate with the currency chosen by the customer in the store?  Did you ever figure out?

Thanks!
14 years ago
Looking at the code there is a line that looks like:

req.DoCaptureRequest.Amount.currencyID = PaypalHelper.GetPaypalCurrency(CurrencyManager.PrimaryStoreCurrency);


You will need to change this so its get currency for the Customer not the primary store currency.

Maybe try something like

req.DoCaptureRequest.Amount.currencyID = PaypalHelper.GetPaypalCurrency(CurrencyManager.GetCurrencyByID(order.Customer.CurrencyID));
14 years ago
Thanks, Skiltz, for the reply.  Unfortunately, I cannot find that code in the website anywhere (I have done several searches).  Would you please be so kind as to let us know which file you found this code in?

Thank you so much!
14 years ago
This is using 1.40.  It also depends which method of PayPal you are using.

if using PayPalStandard then the line looks like:

           builder.Append(string.Format("&no_note=1&currency_code={0}", HttpUtility.UrlEncode(CurrencyManager.PrimaryStoreCurrency.CurrencyCode)));


change to            

builder.Append(string.Format("&no_note=1&currency_code={0}", HttpUtility.UrlEncode(order.CustomerCurrencyCode)));

This is in \Payment\Nop.Payment.PayPal\PayPalStandardPaymentProcessor.cs


If using another paypal method my post above will need to be used.
14 years ago
Thanks again, Skiltz, for such a fast reply.

I was using nopCommerce 1.30, but if nopCommerce 1.40 will let me do it and 1.30 won't than I'll switch.  My site is already online, so I am wondering if perhaps this code must be changed before I build it or something?

Please enlighten me a little further.  Thank you so much!
14 years ago
You can apply the same logic to 1.3 - Look in the PayPalStandardPaymentProcessor.cs file.
14 years ago
Thank you.  I found it in the not "NoSource" files.  I have changed it in my local files, but how can I transfer this to the internet?

Again, thank you so much for your support.
14 years ago
You will need to recompile the project and the upload the DLL to the webserver.  Have you made any other changes to the source?
14 years ago
Thank you very much!  You are very very helpful!

No, that is the only change that I have made to the source.  I have never compiled before, and am not exactly sure how to proceed.  Can I do it from Visual Web Developer Express 2008?  Forgive my ignorance.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.