- Posts: 42
- Thank you received: 2
Only show sub currency for PayPal ZAR {SOLVED}
-- Joomla version -- : 3.2.0
-- PHP version -- : 5.4.24
-- Browser(s) name and version -- : Safari 7.0.1
Hi!
We are a South African site wanting to use PayPal as our payment method. We know that ZAR is not supported, but we have had success setting primary currency as USD. Is it possible (via editing choice code) to display only the ZAR amount on the store and checkout? Currently we can get the products to display like this: $1.00 (R 0.50) etc
And we can get the checkout to display like this: $1.00
It it crucial that we display the store: R 0.50
and Checkout: R0.50
Even if the primary currency is set to USD in the backend.
We need to only display the ZAR value until the cart value is passed to the paypal page. Once directed to paypal, the $ price will be fine.
Many thanks,
Bruce Atkinson
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
The solution will probably be to
- Set the main currency of your shop to ZAR
- Edit the code of the file : "plugins\hikashoppayment\paypal\Paypal.php" so that you'll directly convert the price of your order to USD and send it to paypal.
Please Log in or Create an account to join the conversation.
My PHP skills are still at the beginner level, I understand basic PHP syntax and logic from other programming languages.
Maybe if we could ask Nicolas or someone similar for a quick code fix? I'd imagine that we'd say ZAR * the current USD exchange rate variable (i.e. the variable containing a value like 0.986567 etc) or something like that?
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
My advice will be to change this line :
And you'll have to convert the total of your order by editing this line :
Please Log in or Create an account to join the conversation.
As we have the Business edition of Hikashop, we are needing to use the auto-currency rates so we'd need to tie those variables into this fix somehow.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
I didn't understood your question, but note that you'll only have to convert the ZAR total to USD like this for example :As we have the Business edition of Hikashop, we are needing to use the auto-currency rates so we'd need to tie those variables into this fix somehow.
Please Log in or Create an account to join the conversation.
Sorry for my confusing question. I'm wanting to turn the:
So that the currency rate will be correct automatically. This was one of the features that caused us to buy Hikashop Business Edition.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Mohamed's Code:
The change:
Instead of:
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
into:
But now the paypal payment plugin is returning a value of 0 to www.paypal.com/za/cgi-bin/webscr ?
And when I use the variable nicholas Provided
I return a value of 1 as it selects the primary ZAR currency. I'm sure my syntax and variable is wrong. Please help! :sick:
Please Log in or Create an account to join the conversation.
It should work. If it doesn't, replace 'USD' by the id of this currency.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
No echo needed.
Please Log in or Create an account to join the conversation.
And enabled debug mode in the PayPal plugin, but it's still returns a blank page. I'm still on Hikashop 2.2.2, would that affect anything?
Please Log in or Create an account to join the conversation.
Turn on the debug mode and error reporting options of the joomla configuration and try again and you should see the error message telling you what's wrong.
Please Log in or Create an account to join the conversation.
Please find error messages below:
The code I've edited:
and
Please Log in or Create an account to join the conversation.
Currenc|/b]y, not "curreny".
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.