YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

2 Pages 12>
Multiple Currency question Options
Guest(old)
#1 Posted : Thursday, November 14, 2002 11:28:16 AM
Rank: Starting Member

Groups: Registered

Joined: 11/12/2002
Posts: 312
Location: ,
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?
Sponsor  
 
PayPal_Mustang
#2 Posted : Thursday, November 14, 2002 11:52:48 AM
Rank: Starting Member

Groups: Registered

Joined: 11/14/2002
Posts: 4
Location: ,
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.
Guest(old)
#3 Posted : Thursday, November 14, 2002 11:58:09 AM
Rank: Starting Member

Groups: Registered

Joined: 11/12/2002
Posts: 312
Location: ,
Thank you for prompt response.
Guest(old)
#4 Posted : Friday, November 15, 2002 8:32:32 PM
Rank: Starting Member

Groups: Registered

Joined: 11/12/2002
Posts: 312
Location: ,
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
paypal_pb
#5 Posted : Friday, November 15, 2002 8:41:43 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
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
Guest(old)
#6 Posted : Thursday, December 05, 2002 11:17:27 PM
Rank: Starting Member

Groups: Registered

Joined: 11/12/2002
Posts: 312
Location: ,
<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
paypal_pb
#7 Posted : Friday, December 06, 2002 12:11:00 AM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
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
DaveC
#8 Posted : Friday, December 06, 2002 7:49:59 AM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 37
Location: ,
&lt;script language=javascript&gt;
function changecurrency()
{
if (ppform.currencycode.value == 'GBP')
{
ppform.amount.value = '10';
}

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

}
&lt;/script&gt;


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

**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
Rob
#9 Posted : Saturday, December 07, 2002 9:00:41 PM
Rank: Starting Member

Groups: Registered

Joined: 12/5/2002
Posts: 8
Location: ,
Dave and all,

OK. I got it to work. The web page I set up is at:
http://www.afana.com/af_whathowjoin.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
DSD_David
#10 Posted : Sunday, December 08, 2002 2:01:24 AM
Rank: Starting Member

Groups: Registered

Joined: 11/30/2002
Posts: 125
Location: ,
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';
}

}


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

Rob
#11 Posted : Monday, December 16, 2002 6:11:43 PM
Rank: Starting Member

Groups: Registered

Joined: 12/5/2002
Posts: 8
Location: ,
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
DaveC
#12 Posted : Tuesday, December 17, 2002 8:04:42 AM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 37
Location: ,
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
Rob
#13 Posted : Tuesday, December 17, 2002 2:56:18 PM
Rank: Starting Member

Groups: Registered

Joined: 12/5/2002
Posts: 8
Location: ,
<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/af_whathowjoin.shtml
Line: 23

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


-Rob de Santos
AFANA.com
paypal_pb
#14 Posted : Tuesday, December 17, 2002 5:34:56 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
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
DaveC
#15 Posted : Tuesday, December 17, 2002 5:47:51 PM
Rank: Starting Member

Groups: Registered

Joined: 11/16/2002
Posts: 37
Location: ,
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
Rob
#16 Posted : Tuesday, December 17, 2002 6:16:41 PM
Rank: Starting Member

Groups: Registered

Joined: 12/5/2002
Posts: 8
Location: ,
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
Rob
#17 Posted : Tuesday, December 17, 2002 6:20:03 PM
Rank: Starting Member

Groups: Registered

Joined: 12/5/2002
Posts: 8
Location: ,
<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
Rob
#18 Posted : Tuesday, December 17, 2002 7:23:46 PM
Rank: Starting Member

Groups: Registered

Joined: 12/5/2002
Posts: 8
Location: ,
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/af_whathowjoin.shtml
http://www.afana.com/currchange.js

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

-Rob de Santos
AFANA.com
jc
#19 Posted : Tuesday, December 24, 2002 9:39:14 AM
Rank: Starting Member

Groups: Registered

Joined: 12/24/2002
Posts: 6
Location: ,
take a look at

http://www.newscoop.co.uk/paypal.htm for a solution
Rob
#20 Posted : Tuesday, December 24, 2002 2:12:19 PM
Rank: Starting Member

Groups: Registered

Joined: 12/5/2002
Posts: 8
Location: ,
<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
Users browsing this topic
Guest
2 Pages 12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.438 seconds.