diff --git a/buch_details.php b/buch_details.php
index 48905eb..c02845f 100644
--- a/buch_details.php
+++ b/buch_details.php
@@ -168,7 +168,10 @@
-
@@ -200,6 +203,33 @@
+
+
+
+
+
+
";
@@ -182,6 +185,28 @@
data.toString();
location.href = url;
}
+
+ function addBookToCart(ID) {
+ // OnClick Event für open_bookDetails stoppen
+ if (!e) var e = window.event;
+ e.cancelBubble = true;
+ if (e.stopPropagation) e.stopPropagation();
+
+ // ID abtrennen
+ ID = ID.replace('shoppingCart', '');
+ alert(ID);
+
+ var request = new XMLHttpRequest();
+ request.open('POST',
+ 'http://141.19.142.11/warenkorb_funktionen.php', true);
+ // TODO: Handler erstellen
+ request.onload = function() {
+ console.log(this.responseText);
+ }
+ request.setRequestHeader('Content-type',
+ 'application/x-www-form-urlencoded');
+ request.send(`function=addBookToCart&id=${ID}`);
+ }
diff --git a/suchergebnisse.php b/suchergebnisse.php
index f71bd35..1c2e397 100644
--- a/suchergebnisse.php
+++ b/suchergebnisse.php
@@ -188,7 +188,7 @@
if ($counter != 0) {
echo "";
}
- // TODO: OnClick auslagern.
+ // TODO: OnClick Event auslagern
echo "
- ";
@@ -253,16 +256,37 @@
-
+