Jump to content


Photo

Multiple Currency question


  • This topic is locked This topic is locked
21 replies to this topic

#1 Guest(old)

Guest(old)

    Junior Member

  • Members
  • 312 posts

Posted 14 November 2002 - 06:28 AM

If I want to make all currencies available on my website, do I have to have five seperate buttons listed, or is there a way that I can have only one button, and a combo box listing the currencies. When the currecny is selected, the button code would then be changed accordingly. Is that possible?

#2 PayPal_Mustang

PayPal_Mustang

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 14 November 2002 - 06:52 AM

Unfortunately you will need to create a button for each currency you would like to accept payment in.

Using a drop down menu may be able to change what currency is used but it will not convert the checkout price. So if I buy an item from you that costs $10. Then select to pay in Sterling. You would receive 10 Sterling. No conversion would occur.

Your friendly neighborhood Tech Support Representative.

#3 Guest(old)

Guest(old)

    Junior Member

  • Members
  • 312 posts

Posted 14 November 2002 - 06:58 AM

Thank you for prompt response.

#4 Guest(old)

Guest(old)

    Junior Member

  • Members
  • 312 posts

Posted 15 November 2002 - 03:32 PM

Theoretically, you should be able to change the value using javascript, but it is not something I would trust though.

Just use the onchange in the select box to change the form.field.value to the new value in the new currency.

DaveC

#5 paypal_pb

paypal_pb

    Advanced Member

  • Members
  • 2,960 posts

Posted 15 November 2002 - 03:41 PM

Keep in mind that a US customer will have no trouble paying you in Euros and that PayPal will show the USD-equivalent on the second page. Pricing your goods in different currencies can introduce complexity which may not be worth it in some situations.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn

#6 Guest(old)

Guest(old)

    Junior Member

  • Members
  • 312 posts

Posted 05 December 2002 - 06:17 PM

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by Guest
[br]Theoretically, you should be able to change the value using javascript, but it is not something I would trust though.

Just use the onchange in the select box to change the form.field.value to the new value in the new currency.

DaveC
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
Since my web site offers 5 different classes of membership it isn't practical to have a different button for each currency type. 25 buttons would drive people nuts.... so a javascript solution is probably the best we can do. I'm not quite adept enough to do this myself so if anyone else can write some sample code I'll be happy to implement it and test it on my site.

-Rob de Santos
AFANA.com

#7 paypal_pb

paypal_pb

    Advanced Member

  • Members
  • 2,960 posts

Posted 05 December 2002 - 07:11 PM

You could put the amounts in a drop-down and have a drop-down and button for each currency.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn

#8 DaveC

DaveC

    Advanced Member

  • Members
  • PipPipPip
  • 37 posts

Posted 06 December 2002 - 02:49 AM

<script language=javascript>
function changecurrency()
{
if (ppform.currencycode.value == 'GBP')
{
ppform.amount.value = '10';
}

if (ppform.currencycode.value == 'USD')
{
ppform.amount.value = '15';
}

}
</script>


<form name=ppform id=ppform method=post action=paypal>
<input type="hidden" name="amount" value="10">
<select name="currency_code" onchange="changecurrency()">
<option value="GBP">UK Pounds</option>
<option value="USD">US Dollars</option>
</select>
<input type=submit>
</form>

**Note
Form cut down for clarity. You need to put in the rest of the variables and the action URL.

This is off the top of my head. Perhaps the JS experts can refine it. (perhaps using a select case statement instead of if then)

Dave.

Web development - http://www.revilloc.com

#9 Rob

Rob

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 07 December 2002 - 04:00 PM

Dave and all,

OK. I got it to work. The web page I set up is at:
http://www.afana.com...athowjoin.shtml

I've still got some tidying up to do and I may want to put all the script code for the functions in a separate file. In summary, I set up a function for each membership type and then simply called the function to set the new cost of membership in the newly selected currency. Everything defaults to US dollars if the user does nothing.


-Rob de Santos
AFANA.com

#10 DSD_David

DSD_David

    Junior Member

  • Members
  • 125 posts

Posted 07 December 2002 - 09:01 PM

I know you can make it even cleaner, but this is a start:

function changecurrency1(currency)
{
if (currency == 'GBP')
{
ppform1.a3.value = '3.50';
}

if (currency == 'CAD')
{
ppform1.a3.value = '8';
}

if (currency == 'JPY')
{
ppform1.a3.value = '630';
}

if (currency == 'EUR')
{
ppform1.a3.value = '6';
}

if (currency == 'USD')
{
ppform1.a3.value = '5';
}

}


<form name=ppform1 method=post action=paypal>
<input type="hidden" name="amount" value="10">
<select name="currency_code" onchange="changecurrency(this.value)">
<option value="GBP">UK Pounds</option>
<option value="USD">US Dollars</option>
</select>
<input type=submit>
</form>



#11 Rob

Rob

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 16 December 2002 - 01:11 PM

Update: I've changed over to DSD_David's code and it works great... in IE. If I put the function code in an include file it fails in Opera so I moved it back into the page. However, it still fails in Netscape... everything from v.4.74 to 7.0 apparently. Not sure what gives but it generates a "function not found" error. Any ideas?



-Rob de Santos
AFANA.com

#12 DaveC

DaveC

    Advanced Member

  • Members
  • PipPipPip
  • 37 posts

Posted 17 December 2002 - 03:04 AM

Hhmm..

DSD's code has a function called changecurrency where he is calling changecurrency1 (note, the 1 on the end).

My code should work OK.

Web development - http://www.revilloc.com

#13 Rob

Rob

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 17 December 2002 - 09:56 AM

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by DaveC
[br]Hhmm..

DSD's code has a function called changecurrency where he is calling changecurrency1 (note, the 1 on the end).

My code should work OK.

Web development - http://www.revilloc.com
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Yea, I got that and my page reflects that as far as I can tell. With further testing, the error I'm getting is in the lines with the ppform reference (eg ppform1.a3.value = '3.50';). Netscape burps and says:
Error: ppform1 is not defined
Source File: http://www.afana.com...athowjoin.shtml
Line: 23

I tested a section using your code and get the same error.


-Rob de Santos
AFANA.com

#14 paypal_pb

paypal_pb

    Advanced Member

  • Members
  • 2,960 posts

Posted 17 December 2002 - 12:34 PM

The amounts do not change on Netscape. I might suggest simplifying and just going with one currency. Japanese users can still pay with their Yen-based credit cards, etc.

Also, I usually advise against doing annual subscriptions since customers normally forget about it.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn

#15 DaveC

DaveC

    Advanced Member

  • Members
  • PipPipPip
  • 37 posts

Posted 17 December 2002 - 12:47 PM

In your form tag, as well as a name, give it an ID, such as

id=ppform1


If that still doesn't work, then within the if statements, try...

document.ppform1.[whatever]

[whatever] is the rest of the code. Netscape seems to want a document as well.

Dave.

Web development - http://www.revilloc.com

#16 Rob

Rob

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 17 December 2002 - 01:16 PM

Thanks Patrick...
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by paypal_pb
The amounts do not change on Netscape.<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
I know that... this is the problem. :-)

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
I might suggest simplifying and just going with one currency. Japanese users can still pay with their Yen-based credit cards, etc. <hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
I'm aware of that, however my orginization is multi-national. We've had single currency payments for over a year. The ability of Canadian and other potential members to pay in their own currency has long been requested. It will also facilitate our ability to payout money in those currencies when needed.
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
Also, I usually advise against doing annual subscriptions since customers normally forget about it.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
We've had no difficulty with this and we e-mail members well in advance advising them to cancel if they so choose. Our renewal rates are 80% and up (and were before PayPal) which we are justifiably proud of.



-Rob de Santos
AFANA.com

#17 Rob

Rob

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 17 December 2002 - 01:20 PM

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by DaveC
In your form tag, as well as a name, give it an ID, such as

id=ppform1


If that still doesn't work, then within the if statements, try...

document.ppform1.[whatever]

[whatever] is the rest of the code. Netscape seems to want a document as well.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Yep, already have the name and id there. So, I'll try the document in the if statements.
Thanks, Dave.


-Rob de Santos
AFANA.com

#18 Rob

Rob

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 17 December 2002 - 02:23 PM

Adding document in front of the the ppform in the "if" statements did the trick. I was able to move the JavaScript back in to a subfile. It works on Opera 5+, IE 6+, and Netscape 6.2+ which is all I can test. It does not work on Netscape 4.7x but I can live with that since those users represent about 1% of my visitors now.

If anyone wants to look at my code.. the links are:
http://www.afana.com...athowjoin.shtml
http://www.afana.com/currchange.js

Thanks for all the help. This should help others, too.

-Rob de Santos
AFANA.com

#19 jc

jc

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 24 December 2002 - 04:39 AM

take a look at

http://www.newscoop.co.uk/paypal.htm for a solution


#20 Rob

Rob

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 24 December 2002 - 09:12 AM

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by jc
[br]take a look at
http://www.newscoop.co.uk/paypal.htm for a solution
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

That's pretty slick. It would take some modification though to work in my situation... I have five different membership types all with different payment amounts. After the holidays, I'll experiment with your code.

UPDATE (1/29/03): I have revised my code on my site to implement jc's method. Works very nicely.

-Rob de Santos
AFANA.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users