Bei folgendem Code kann man eine Währung auslesen,
bei den unten folgenden 3 Angeboten wird dann die gewählt Währung mit entsprechendem Betrag eingefügt.
Eines der drei Angebote kann man dann auswählen und per Paypal bezahlen.
Auf einer Testseite lief das alles unter IE und Firefox.
Nun in einer Joomla!-Seite geht das nur noch teilweise:
Unter IE7 und Firefox wird die gewählte Währung in den drei Angeboten nicht mehr automatisch ersetzt.
Der Rest geht!
Mit IE6 geht es auch.
Hat jemand eine Ahnung, an was das liegen könnte?
Für Hilfe wäre ich sehr dankbar...
Code: Alles auswählen
<SCRIPT type="text/JavaScript">
<!--
/* Währung und Preis austauschen */
function change_currency(currency)
{
if (currency == "EUR")
{
document.all.comfort3.innerHTML = "EUR 30.-";
document.all.comfort10.innerHTML = "EUR 60.-";
document.all.comfort20.innerHTML = "EUR 120.-";
}
else if (currency == "CHF")
{
document.all.comfort3.innerHTML = "CHF 50.-";
document.all.comfort10.innerHTML = "CHF 120.-";
document.all.comfort20.innerHTML = "CHF 220.-";
}
else if (currency == "USD")
{
document.all.comfort3.innerHTML = "USD 40.-";
document.all.comfort10.innerHTML = "USD 100.-";
document.all.comfort20.innerHTML = "USD 200.-";
}
}
/* Vor dem Senden Eingaben überprüfen und Daten ins Paypal-Formular einfüllen */
function send()
{
var vCurrency = document.paypal.currency.selectedIndex;
if (document.paypal.agb.checked != true)
{
alert("Sie müssen die AGB's akzeptieren!");
return false;
}
else
{
if (document.paypal.product[0].checked == true)
{
document.paypal.item_name.value = "Comfort Package 3";
if (document.paypal.currency.selectedIndex == 0) {
document.paypal.currency_code.value = "EUR";
document.paypal.amount.value = "30.00";
}
if (document.paypal.currency.selectedIndex == 1) {
document.paypal.currency_code.value = "CHF";
document.paypal.amount.value = "50.00";
}
if (document.paypal.currency.selectedIndex == 2) {
document.paypal.currency_code.value = "USD";
document.paypal.amount.value = "40.00";
}
}
else if (document.paypal.product[1].checked == true)
{
document.paypal.item_name.value = "Comfort Package 10";
if (document.paypal.currency.selectedIndex == 0) {
document.paypal.currency_code.value = "EUR";
document.paypal.amount.value = "60.00";
}
if (document.paypal.currency.selectedIndex == 1) {
document.paypal.currency_code.value = "CHF";
document.paypal.amount.value = "120.00";
}
if (document.paypal.currency.selectedIndex == 2) {
document.paypal.currency_code.value = "USD";
document.paypal.amount.value = "100.00";
}
}
else if (document.paypal.product[2].checked == true)
{
document.paypal.item_name.value = "Comfort Package 20";
if (document.paypal.currency.selectedIndex == 0) {
document.paypal.currency_code.value = "EUR";
document.paypal.amount.value = "120.00";
}
if (document.paypal.currency.selectedIndex == 1) {
document.paypal.currency_code.value = "CHF";
document.paypal.amount.value = "220.00";
}
if (document.paypal.currency.selectedIndex == 2) {
document.paypal.currency_code.value = "USD";
document.paypal.amount.value = "200.00";
}
}
return true;
}
}
//-->
</SCRIPT>
<form name="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return send()">
<span>Wahl der Währung:</span>
<select onchange="change_currency(this.options[this.selectedIndex].value);" name="currency">
<option value="EUR" selected>EURO</option>
<option value="CHF">Schweizer Franken</option>
<option value="USD">US-Dollar</option>
</select>
<br />
<br />
<input type="radio" name="product" id="product" value="3">Comfort 3 Package, Preis: <span id="comfort3">EUR 30.-</span><br />
<input type="radio" name="product" id="product" value="10">Comfort 10 Package, Preis: <span id="comfort10">EUR 60.-</span><br />
<input type="radio" name="product" id="product" value="20">Comfort 20 Package, Preis: <span id="comfort20">EUR 120.-</span> <br />
<br /><br />
<span>Ich akzeptiere die AGBs: </span>
<input type="checkbox" name="agb" id="agb" value="ja">
<br /><br />
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="beispiel@beispiel.com">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="amount" value="">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="">
<input type="hidden" name="lc" value="CH">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.paypal.com/de_DE/i/btn/x-click-but01.gif" border="0" name="submit" alt="Zahlen Sie mit PayPal - schnell, kostenlos und sicher!">
<img alt="" border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1">
</form>