Please verify you are human

PayPal Gutscheincode einfügen (Javascript)
  Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 14:12

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



PayPal Gutscheincode einfügen (Javascript)

Discussion on PayPal Gutscheincode einfügen (Javascript) within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1


 
Sorrow91's Avatar
 
elite*gold: 0
Join Date: Apr 2013
Posts: 90
Received Thanks: 12
PayPal Gutscheincode einfügen (Javascript)

Hallo,

ich habe auf meiner Seite den PayPal "Buy now" Button eingefügt.

Nun wollte ich noch ein Gutscheincodefeld hinzufügen, ich habe schon gegoogled, dort fand ich schon etwas ansatzweise brauchbares, aber leider komme ich nicht weiter.

Hier mein aktueller Code:

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
 font-family: Arial;
 font-size: 12px;
 color:#FFFFFF;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: left top;
	background-color: #02071b;
}
a img {
border: none;
}
</style>
<script type="text/javascript" src="scripts/discount.js"></script>
<script language="JavaScript" src="scripts/overlib.js" type="text/javascript"></script>
<title>PayPal</title>
</head>
<body>
<br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="">
<input type="hidden" name="lc" value="DE">
<input type="hidden" name="item_name" value="Referral Service 2.0">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="basedes" value="Referral Service 2.0">
<input type="hidden" name="bn" value="PP-BuyNowBF:paypal button.png:NonHostedGuest">
<table align="center">
<tr align="center">
<td align="center">
<input type="hidden" name="on0" value="Quantity">
<b>Quantity</b>
</td>
</tr>
<tr align="center">
<td align="center">
<select name="os0">
        <option value="10 Referrals">10 Referrals &euro;5,00 EUR</option>
        <option value="25 Referrals">25 Referrals &euro;10,00 EUR</option>
        <option value="50 Referrals">50 Referrals &euro;20,00 EUR</option>
        <option value="25 Referrals">75 Referrals &euro;30,00 EUR</option>
        <option value="100 Referrals">100 Referrals &euro;40,00 EUR</option>
        <option value="150 Referrals">150 Referrals &euro;50,00 EUR</option>
</select> 
</td>
</tr>
<tr align="center">
<td align="center">
<input type="hidden" name="on1" value="Referral-Link"><font size="2px"><br />
<b>Referral-Link</b></font>
</td>
</tr>
<tr align="center">
<td align="center"><input type="text" name="os1" maxlength="200">
</td>
</tr>
<tr align="center">
<td align="center">
<input type="hidden" name="on2" value="Emailadress/Skype"><font size="2px"><br />
<b>Email Adress or Skypename</b></font>
</td>
</tr>
<tr align="center">
<td align="center">
<input type="text" name="os2" maxlength="200">
</td>
</tr>
<tr align="center">
<td align="center">
<input type="hidden" name="on3" value="Friend"><font size="2px"><br />
<b>Friend advertising</b></font>&nbsp;<img src="Pictures/Information-icon.png" style="cursor:help" border="0" width="15" height="15" onmouseover="return overlib('If you buy 75 or more Referrals and you where recruided by a friend, typing here his name and he gets 10 Referrals for free!');" 
onmouseout="return nd();" />
</td>
</tr>
<tr align="center">
<td align="center">
<input type="text" name="os3" maxlength="200">
</td>
</tr>
<<tr align="center">
<td align="center">
<font size="2px"><br /><b>Couponcode</b></font>
</td>
</tr>
<tr align="center">
<td align="center">
<input type="text" size="20"  name="coupcode"; />
<br />
<input type="button" value="Check code" onclick="coupval =this.form.coupcode.value;  ChkCoup();" />
</td>
</tr>
</table>
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="option_select0" value="10 Referrals">
<input type="hidden" name="option_amount0" value="5.00">
<input type="hidden" name="option_select1" value="25 Referrals">
<input type="hidden" name="option_amount1" value="10.00">
<input type="hidden" name="option_select2" value="50 Referrals">
<input type="hidden" name="option_amount2" value="20.00">
<input type="hidden" name="option_select3" value="75 Referrals">
<input type="hidden" name="option_amount3" value="30.00">
<input type="hidden" name="option_select4" value="100 Referrals">
<input type="hidden" name="option_amount4" value="40.00">
<input type="hidden" name="option_select5" value="150 Referrals">
<input type="hidden" name="option_amount5" value="50.00">
<input type="hidden" name="option_index" value="0">
<br>
<center>
<input onclick="self.close(); CalculateOrder(this.form)" name="submit" type="image" src="Pictures/paypal button.png" alt="PayPal" border="0" formtarget="_blank">
</center>
</form>
</body>
</html>
Und hier die discount.js Datei

HTML Code:
<!--
var discnt = 0;   // no default percent discount

var coupons = new Array (  // place to put coupon codes
  "gutschein10"
);
var coupdc  = new Array (  // place to put discounts for coupon vals
  10
);
var coupval = "(blanket)"; // what user entered as coupon code

function ChkCoup () {      // check user coupon entry
var i;
  discnt = 0;              // assume the worst
  for (i=0; i<coupons.length; i++) {
    if (coupval == coupons[i]) {
      discnt = coupdc[i];  // remember the discount amt
      alert ("This is a valid coupon code! \n\n" + "€" + discnt +
             " discount now in effect.");
      return;
    }
  }
  alert ("'" + coupval + "'  is not a valid coupon code!");
}

function Euro (val) {      // force to valid dollar amount
var str,pos,rnd=0;
  if (val < .995) rnd = 1;  // for old Netscape browsers
  str = escape (val*1.0 + 0.005001 + rnd);  // float, round, escape
  pos = str.indexOf (".");
  if (pos > 0) str = str.substring (rnd, pos + 3);
  return str;
}

function ReadForm (obj1) {  // apply the discount
var amt,des;
  amt = obj1.baseamt.value*1.0;       // base amount
  des = obj1.basedes.value;           // base description

  if (discnt > 0) {                   // only if discount is active
    amt = Euro (amt - (amt * discnt/100.0));
    des = des + ", " + "€" + discnt + "dis, COUP = " + coupval;
  }

  obj1.amount.value = Euro (amt);
  obj1.item_name.value = des;
}
//-->
Leider berechnet er mir nicht den richtigen Wert, ich denke das liegt daran dass ich dort ein Dropdownmenü zur Auswahl drin habe.

Und er zieht den Wert nicht richitg ab.
Also sagen wir ich kaufe 100 Stück für 40€ und gebe den Gutscheincode "gutschein10" ein, somit müssten 4€ eingespart werden.
Leider gibt er mir immer €10 aus...

Ich bitte um Hilfe und danke schonmal für die Mühe

Grüße

Sorrow91
Sorrow91 is offline  
Old 07/21/2013, 14:56   #2
 
elite*gold: 0
Join Date: Apr 2005
Posts: 323
Received Thanks: 114
Vermutlich wird immer ein Coupon mit dem Wert 100 gewählt. Überprüf ob du deine Coupons in dem Abschnitt wo du sie definierst, richtig eingetragen hast.
MrPuschel is offline  
Old 07/21/2013, 18:50   #3


 
Sorrow91's Avatar
 
elite*gold: 0
Join Date: Apr 2013
Posts: 90
Received Thanks: 12
Quote:
Originally Posted by MrPuschel View Post
Vermutlich wird immer ein Coupon mit dem Wert 100 gewählt. Überprüf ob du deine Coupons in dem Abschnitt wo du sie definierst, richtig eingetragen hast.
Hey, erstmal danke für die Antwort.

Leider kenne ich mich nicht so gut aus, habe mir das ganze "ergoogled"...
Meinst du du könntest mich bei Skype adden und einmal über das ganze drüber schauen?

Skype: Sorrow_1991
Sorrow91 is offline  
Old 07/21/2013, 20:16   #4
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
javascript ist feindesland, da willst du nen rabatt berechnen?
tolio is offline  
Old 07/21/2013, 20:27   #5


 
Sorrow91's Avatar
 
elite*gold: 0
Join Date: Apr 2013
Posts: 90
Received Thanks: 12
Quote:
Originally Posted by tolio View Post
javascript ist feindesland, da willst du nen rabatt berechnen?
Also wenn es eine andere Möglichkeit gibt das ganze mit dem "Buy now" button von Paypal zu machen bin ich offen für alles
Sorrow91 is offline  
Old 07/21/2013, 22:13   #6
 
elite*gold: 0
Join Date: Apr 2005
Posts: 323
Received Thanks: 114
Quote:
Originally Posted by tolio View Post
javascript ist feindesland, da willst du nen rabatt berechnen?
Er ermittelt nur welcher Gutschein eingegeben wurde und gibt dem Nutzer zurück was er zu erwarten hat. Die Validierung macht PayPal.

Ich denke aber du solltest es wirklich lassen wenn du Gutscheine benutzen möchtest aber noch nicht einmal darüber nachgedacht hast wie die Gutscheine heißen und wo sie definiert sind.
MrPuschel is offline  
Old 07/21/2013, 23:00   #7
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
naja gut wenns nur anzeige ist dann isses wayne, aber dann ist es ja auch kein problem das grad anzuzeigen
tolio is offline  
Old 07/22/2013, 00:06   #8


 
Sorrow91's Avatar
 
elite*gold: 0
Join Date: Apr 2013
Posts: 90
Received Thanks: 12
Alo er ermittelt und übergibt Paypal nur nicht die richtigen Werte, wenn mir einer von euch evlt helfen könnte oder den verbesserten Code mir hier posten könne
Sorrow91 is offline  
Old 07/25/2013, 22:18   #9


 
Sorrow91's Avatar
 
elite*gold: 0
Join Date: Apr 2013
Posts: 90
Received Thanks: 12
#Push

Habe bei Paypal noch eine input Funktion namens discount_rate gefunden

Hier ist eine Beschreibung von Paypal:


Nur da ich nicht über die Kenntnisse verfüge das ganze mit dem oben angegeben Code umzusetzen, frage ich hier.

Kennt jemand die Lösung?

Kann mich gerne bei Skype adde: sorrow_1991
Sorrow91 is offline  
Reply


Similar Threads Similar Threads
[B] Webapps mit HTML5, CSS3, JavaScript (+ jQuery ), PHP und MySQL [S] PayPal, PSC
02/04/2013 - Coders Trading - 5 Replies
Hey, Biete: Webapps mit HTML5, CSS3, JavaScript (+ jQuery ), PHP und MySQL. Kosten:
JavaScript onClick img einfügen
10/12/2012 - General Coding - 0 Replies
Hey Leute, ich hab eine Frage zu JavaScript. Ich kenn mich damit eigentlich überhaupt nicht aus, und hab deswegen nach Programmen gesucht die mir das Coding erstellen und bin dann bei Fast Image Map gelandet, doch leider verstehe ich das Programm nicht wirklich. Und zwar geht es mir darum, ich hab ein Bild (von einer MiniMap in aus einem Spiel) und möchte dort per Mausklick ein Icon drauf setzten, sprich auf der MiniMap wird dann zumbeispiel der Avatar eines Charakters angezeigt. Es...
[Suche]100€ Amazon Gutscheincode [Biete] Paypal
06/28/2012 - Trading - 4 Replies
Hallo Leute, Ich suche derzeit einen 100€ Amazongutdceincode. Würde über Paypal Zahlen. Biete unter diesen Post bei Interesse Antworten oder in Skype: NowCrazyLive .#Crazy
[S] Mt2 Gutscheincode [B] PSC
12/11/2011 - Metin2 Trading - 0 Replies
Suche einen 25 euro Metin2 Gutscheincode. Biete PSC.. Skype : Colastift
PayPal Gutscheincode für Zalando
10/27/2011 - elite*gold Trading - 2 Replies
Topic Schuhe & Mode jetzt im Sale bis zu 30 % reduziert | ZALANDO Hier einlösbar mit paypal only Gebote pls 10€ Rabbat



All times are GMT +1. The time now is 14:13.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.