ich habe mal die Modulausgabe von Shopausgabe ein bischen angepasst, so könnte es gehen das bei der Bestellung AGB und Wiederuf berücksicht wird und darunter noch mal der Warenkorb um die Übersicht vor der Bestellung zu gewährleisten.
Code: Alles auswählen
<?php
global $REX;
require_once ($REX['INCLUDE_PATH'] .'/addons/tvsshop/classes/shopUrlRewrite.inc.php');
if (!isset ($_SESSION)) { session_start(); }
$table_pre = $REX['TABLE_PREFIX'] . $REX['ADDON']['rxid']['tvsshop'];
$thispage = "tvsshop";
$art_table = $table_pre . "_articles";
$cat_table = $table_pre . "_categories";
$orders_table= $table_pre . "_orders";
$article_id = "REX_ARTICLE_ID";
$tvsshop_mode = rex_get('mode', 'string');
if ($tvsshop_mode == "")
$tvsshop_mode = rex_post('mode', 'string');
// Supported Modes:
// addtocart
// showbasket
// delorderpos
// clearbasket
// checkout
// sendorder
// orderfinished
// ----------------
$tvsshop_art_id = rex_get('art_id', 'int', -1);
if ($tvsshop_art_id == -1)
$tvsshop_art_id = rex_post('art_id', 'int', -1);
if (!function_exists('clearBasket')) {
function clearBasket() {
global $_SESSION;
$_SESSION['tvsshop']['cart']['art_id'] = "";
$_SESSION['tvsshop']['cart']['art_count'] = "";
$_SESSION['tvsshop']['cart']['art_sumtotal'] = 0;
$_SESSION['tvsshop']['cart']['art_features'] = "";
$_SESSION['tvsshop']['cart']['ordertext'] = "";
$_SESSION['tvsshop']['cart']['mailordertext'] = "";
}
}
if (!function_exists('backToShopLink')) {
function backToShopLink() {
echo "<p><a href=\"" . rex_getUrl('','', array('mode'=>'')) . "\">Zurück zum Onlineshop</a></p>";
}
}
if (!function_exists('showBasketLink')) {
function showBasketLink() {
// global $_SESSION;
// $articles_count = 0;
// $articles_sum_count = 0;
//
// if (!isset ($_SESSION)) {
// session_start();
// } else {
// $articles_count = explode(",", $_SESSION['tvsshop']['cart']['art_count']);
// $articles_sum_count = 0;
// if ($articles_count > 0) {
// foreach ($articles_count as $i => $value) {
// $articles_sum_count = $articles_sum_count + doubleval($value);
// }
// }
// }
// echo "<p><a href=\"" . rex_getUrl('','', array('mode'=>'showbasket'), '&') . "\" title=\"Warenkorb anzeigen\">Warenkorb anzeigen</a> (" . $articles_sum_count . " Artikel)</p>";
}
}
// Rewriting benutzen...
if (OOAddon :: isAvailable('rexseo') || OOAddon :: isAvailable('seo42'))
$article_url = getTvsShopUrl($tvsshop_art_id, $REX['CUR_CLANG']);
else
$article_url = rex_getUrl('','', array('art_id'=>$tvsshop_art_id));
//
$tvsshop_cat = rex_get('tvsshop_cat', 'int', -1);
$tvsshop_sort = rex_get('art_sort', 'int', -1);
if ($tvsshop_sort == -1 && "REX_VALUE[3]" != "")
$tvsshop_sort = "REX_VALUE[3]";
if ($tvsshop_cat == -1 && "REX_VALUE[2]" != "")
$tvsshop_cat = "REX_VALUE[2]";
$tvsshop_art_count = rex_get('art_count', 'int', -1);
$tvsshop_art_feature= rex_get('art_feature', 'string', '');
$tvsshop_tag = rex_get('tag', 'string', '');
$tvsshop_start = rex_get('tvsshop_start', 'int', -1);
if ($tvsshop_start != -1) {
$tvsshop_limit = "REX_VALUE[1]";
} else {
if ("REX_VALUE[1]" == "") {
$tvsshop_start = 0;
$tvsshop_limit = 5;
} else {
$tvsshop_start = 0;
$tvsshop_limit = "REX_VALUE[1]";
}
}
if ("REX_VALUE[4]" == "" || "REX_VALUE[4]" == "A")
$tvsshop_asc = " ASC";
else
$tvsshop_asc = " DESC";
// INI-Variablen
$myIniFile = $REX['INCLUDE_PATH'] . "/addons/" . $thispage . "/" . $thispage . ".ini";
$settings = parse_ini_file($myIniFile);
$shopname = $settings['Shopname'];
$imagesize = $settings['ImageSize'];
$usefacebook= $settings['UseFacebook'];
$currency = $settings['Currency'];
$shopmail = $settings['Shopmail'];
$shipping = str_replace(",",".",$settings['Shipping']);
$mwst = $settings['MwSt'];
if ($mwst > 1)
$mwstfaktor = ($mwst / 100) + 1;
// Sortierung übergeben...
$sql_sort = "";
if ($tvsshop_sort > -1)
if ($tvsshop_sort == 0)
$sql_sort = "title";
elseif ($tvsshop_sort == 1)
$sql_sort = "price";
elseif ($tvsshop_sort == 2)
$sql_sort = "artnr";
else
$sql_sort = "title";
$sql_limit = " LIMIT " . $tvsshop_start . ", " . $tvsshop_limit;
if($tvsshop_cat > -1) {
$tvssql = " AND category_id = " . $tvsshop_cat;
$sql = new rex_sql();
$sql->setQuery("SELECT * FROM " . $cat_table . " WHERE id = " . $tvsshop_cat);
if ($sql->getRows() > 0 ) {
echo "<h1>Artikel in der Kategorie '" . $sql->getValue('title') . "':</h1>";
}
}
else {
$tvssql = ""; }
if ($tvsshop_tag != "")
$tvssql .= " AND keywords like '%" . $tvsshop_tag . "%'";
// post_id hat Priorität...
if ($tvsshop_art_id != -1)
$tvssql .= " AND id = " . $tvsshop_art_id;
//
// Ab hier die Modus Operandi ausarbeiten ;-)
//
if ($tvsshop_mode == "addtocart") {
// Ãœbergebenen Artikel dem Warenkorb hinzufügen...
// Ãœbergebenen Artikel dem Warenkorb hinzufügen...
if ($_SESSION[$thispage]['cart']['art_id'] == '') {
$articles = array();
$articles_count = array();
}
else {
$articles = explode(",",$_SESSION[$thispage]['cart']['art_id']);
$articles_count = explode(",", $_SESSION[$thispage]['cart']['art_count']);
}
$key = array_search($tvsshop_art_id, $articles);
if ($key > -1) {
$articles_count[$key] = doubleval($articles_count[$key]) + $tvsshop_art_count;
} else {
array_push($articles, $tvsshop_art_id);
array_push($articles_count, $tvsshop_art_count);
}
$_SESSION[$thispage]['cart']['art_id'] = implode(",",$articles);
$_SESSION[$thispage]['cart']['art_count'] = implode(",",$articles_count);
$tvsshop_mode = "showbasket";
}
if ($tvsshop_mode == "clearbasket") {
// Warenkorb löschen...
clearBasket();
backToShopLink();
}
if ($tvsshop_mode == "delorderpos") {
// Artikelposition löschen...
$articles = explode(",",$_SESSION[$thispage]['cart']['art_id']);
$articles_count = explode(",", $_SESSION[$thispage]['cart']['art_count']);
$key = array_search($tvsshop_art_id, $articles);
if ($key > -1) {
array_splice ($articles, $key, 1);
array_splice ($articles_count, $key, 1);
}
$_SESSION[$thispage]['cart']['art_id'] = implode(",",$articles);
$_SESSION[$thispage]['cart']['art_count'] = implode(",",$articles_count);
$tvsshop_mode = "showbasket";
}
if ($tvsshop_mode == "sendorder") {
// Bestellformular senden...
$kdnr = urldecode(rex_get('tvsshop_kdnr', 'string'));
$name = urldecode(rex_get('tvsshop_name', 'string'));
$strasse = urldecode(rex_get('tvsshop_strasse', 'string'));
$plzort = urldecode(rex_get('tvsshop_plzort', 'string'));
$email = urldecode(rex_get('tvsshop_email', 'string'));
$telefon = urldecode(rex_get('tvsshop_telefon', 'string'));
$errormsg = "";
if ($settings['Name_required'] == "1" && trim($name) == "")
$errormsg .= "Bitte NAMEN eingeben<br />";
if ($settings['Street_required'] == "1" && trim($strasse) == "")
$errormsg .= "Bitte STRASSE eingeben<br />";
if ($settings['Town_required'] == "1" && trim($plzort) == "")
$errormsg .= "Bitte PLZ und ORT eingeben<br />";
if ($settings['Phone_required'] == "1" && trim($telefon) == "")
$errormsg .= "Bitte TELEFON eingeben<br />";
if ($settings['Email_required'] == "1" && trim($email) == "")
$errormsg .= "Bitte EMAIL eingeben<br />";
if ($errormsg != "") {
echo "<h2>Folgende Informationen fehlen:</h2><p>" . $errormsg . "</p>";
$tvsshop_mode = "checkout";
} else {
$order = file_get_contents( $REX['INCLUDE_PATH'] . "/addons/tvsshop/pages/order.txt");
// $order = $_SESSION['tvsshop']['cart']['mailordertext'];
$to_search = array("{datum}","{uhrzeit}","{shopname}","{kdnr}","{name}","{strasse}","{plzort}","{email}","{telefon}","{bestelltext}");
$to_replace = array(date("d.m.Y"),date("H:i:s"),$shopname,$kdnr,$name,$strasse,$plzort,$email,$telefon,$_SESSION['tvsshop']['cart']['mailordertext']);
$order = str_replace($to_search, $to_replace, $order);
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/plain, charset=utf-8\r\n";
$header .= "Content-Transfer-Encoding: 8bit\r\n";
$header .= "From: $shopmail\r\n";
$header .= "X-Mailer: PHP " . phpversion() . "\r\n";
// Bestellung speichern...
$sql = new rex_sql();
$sql->setQuery("INSERT INTO " . $orders_table . " (customer, ordertext, status, create_date) VALUES ('" . $customer. "','" . $order . "',0," . time() . ")");
//
if ($shopmail != "") {
mail($shopmail, $shopname . ": Neue Bestellung vom " . date("d.m.Y H:i:s"), $order, $header, "-f" . $shopmail);
} else {
echo "<p>Keine Shopbetreiber-EMail-Adresse angegeben!</p>";
$tvsshop_mode = "checkout";
}
if ($email != "") {
mail($email, $shopname . ": Ihre Bestellung vom " . date("d.m.Y H:i:s"), $order, $header, "-f" . $shopmail);
}
$tvsshop_mode = "orderfinished";
}
}
if ($tvsshop_mode == "orderfinished") {
// Bestellvorgang abgeschlossen...
echo "<p>Vielen Dank für Ihre Bestellung!</p>";
echo "<p>Sie sollten in wenigen Minuten eine Bestätigung in Ihrem EMail-Postfach erhalten!</p>";
clearBasket();
$tvsshop_mode == "";
backToShopLink();
} elseif ($tvsshop_mode == "checkout") {
// Bestellformular zeigen...
echo "<div class=\"tvsshop_checkout\">";
echo "<h1>Kasse</h1>";
echo "<form id=\"tvsshop_checkout\" method=\"get\" action=\"" . rex_getUrl('') . "\">";
// echo "<p>Artikelsumme: " . sprintf("%01.2f",$_SESSION[$thispage]['cart']['art_sumtotal']) . $currency . "</p>";
//showBasketLink();
echo "<input name=\"mode\" type=\"hidden\" value=\"sendorder\" />";
echo "<input name=\"tvsshop_art_id\" type=\"hidden\" value=\"" . $_SESSION[$thispage]['cart']['art_id'] . "\" />";
echo "<input name=\"tvsshop_art_count\" type=\"hidden\" value=\"" . $_SESSION[$thispage]['cart']['art_count'] . "\" />";
echo "<label for=\"tvsshop_kdnr\">KdNr. (sofern vorhanden):</label>";
echo "<input name=\"tvsshop_kdnr\" type=\"text\" value=\"" . $kdnr . "\" />";
echo "<label for=\"tvsshop_name\">Vorname/Name:" . (($settings['Name_required'] == "1") ? " (*)" : "") . "</label>";
echo "<input name=\"tvsshop_name\" type=\"text\" value=\"" . $name . "\" />";
echo "<label for=\"tvsshop_strasse\">Strasse:" . (($settings['Street_required'] == "1") ? " (*)" : "") . "</label>";
echo "<input name=\"tvsshop_strasse\" type=\"text\" value=\"" . $strasse . "\" />";
echo "<label for=\"tvsshop_plzort\">PLZ/Ort:" . (($settings['Town_required'] == "1") ? " (*)" : "") . "</label>";
echo "<input name=\"tvsshop_plzort\" type=\"text\" value=\"" . $plzort . "\" />";
echo "<label for=\"tvsshop_telefon\">Telefon:" . (($settings['Phone_required'] == "1") ? " (*)" : "") . "</label>";
echo "<input name=\"tvsshop_telefon\" type=\"text\" value=\"" . $telefon . "\" />";
echo "<label for=\"tvsshop_email\">E-Mail:" . (($settings['Email_required'] == "1") ? " (*)" : "") . "</label>";
echo "<input name=\"tvsshop_email\" type=\"text\" value=\"" . $email . "\" />";
echo "<p style=\"clear:both;\">Ich habe die [<a href=\"" . rex_getUrl(3) . "\" title=\"AGB anzeigen\">AGB</a>] des Anbieters gelesen und erkläre mit dem Absenden der Bestellung mein Einverständnis.<br/>Die [<a href=\"" . rex_getUrl(4) . "\" title=\"Widerrufsbelehrung anzeigen\">Widerrufsbelehrung</a>] habe ich zur Kenntnis genommen.</p>";
echo "<p style=\"clear:both;\">(*) Angaben werden benötigt!</p>";
echo "<input name=\"abschicken\" class=\"submit\" type=\"submit\" value=\"Zahlungspflichtig bestellen\" />";
echo "</form>";
echo "<p>---------------------------- Ihre Bestellung ----------------------------------</p>";
// Warenkorb einfügen ==========================================================================
echo "<div class=\"tvsshop_basket\">";
echo "<h1>Warenkorb</h1>";
if ($_SESSION[$thispage]['cart']['art_id'] != '') {
$articles = explode(",", $_SESSION[$thispage]['cart']['art_id']);
$articles_count = explode(",", $_SESSION[$thispage]['cart']['art_count']);
$articles_sum_count = 0;
$articles_sum = 0;
$articles_ordertext = "";
$articles_mailordertext = "";
$articles_ordertext .= "<table class=\"tvsshop_art_table\" summary=\"Warenkorb\">";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <th class=\"art_col_1\">Titel</th>";
$articles_ordertext .= " <th class=\"art_col_2\">Anzahl</th>";
$articles_ordertext .= " <th class=\"art_col_3\">Einzelpreis</th>";
$articles_ordertext .= " <th class=\"art_col_4\">Summe</th>";
$articles_ordertext .= " <th class=\"art_col_5\"> </th>";
$articles_ordertext .= "</tr>";
$articles_mailordertext .= "Titel" . chr(9) . "Anzahl" . chr(9) . "Summe\n";
$sql = new rex_sql();
foreach ($articles as $i => $value) {
$sql->setQuery("SELECT * FROM " . $art_table . " WHERE id = " . $value . " AND status = 1");
if ($sql->getRows() > 0 )
{
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\"><a href=\"" . $article_url . "\" title=\"" . $sql->getValue('title') . "\">" . $sql->getValue('title') . "</a></td>";
$articles_ordertext .= " <td class=\"art_col_2\">" . $articles_count[$i] . "</td>";
$articles_ordertext .= " <td class=\"art_col_3\">" . sprintf("%01.2f",$sql->getValue('price')) . " " . $currency . "</td>";
$articles_ordertext .= " <td class=\"art_col_4\">" . sprintf("%01.2f",$sql->getValue('price') * doubleval($articles_count[$i])) . " " . $currency . "</td>";
$articles_ordertext .= " <td class=\"art_col_5\"><a href=\"" . rex_getUrl('','', array('mode'=>'delorderpos','art_id'=>$sql->getValue('id'))) . "\" title=\"Artikel entfernen\">entfernen</a></td>";
$articles_sum = $articles_sum + $sql->getValue('price') * doubleval($articles_count[$i]);
$articles_sum_count = $articles_sum_count + doubleval($articles_count[$i]);
$articles_ordertext .= "</tr>";
$articles_mailordertext .= $sql->getValue('title') . chr(9) . $articles_count[$i] . chr(9) . sprintf("%01.2f",$sql->getValue('price') * doubleval($articles_count[$i])) . " " . $currency . "\n";
$sql->next();
}
}
$_SESSION[$thispage]['cart']['art_sumtotal'] = $articles_sum;
if ($mwst <> 0) {
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\">Summe Netto:</td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\">" . sprintf("%01.2f",$articles_sum / $mwstfaktor) . " " . $currency . "</td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\">zzgl. MwSt." . $mwst . "%:</td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\">" . sprintf("%01.2f",$articles_sum - ($articles_sum / $mwstfaktor)) . " " . $currency . "</td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\">Summe Brutto:</td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\"><b>" . sprintf("%01.2f",$articles_sum) . " " . $currency . "</b></td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
}
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\">Versandkosten:</td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\"><b>" . sprintf("%01.2f",$shipping) . " " . $currency . "</b></td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\"><b>Gesamtsumme:</b></td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\"><b>" . sprintf("%01.2f",$articles_sum + $shipping) . " " . $currency . "</b></td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "</table>";
$articles_mailordertext .= "Versandkosten" . chr(9) . chr(9) . sprintf("%01.2f",$shipping) . " " . $currency . "\n";
$articles_mailordertext .= "Gesamt:" . chr(9) . $articles_sum_count . chr(9) . sprintf("%01.2f",$articles_sum + $shipping) . " " . $currency . "\n";
echo $articles_ordertext;
$_SESSION['tvsshop']['cart']['mailordertext'] = $articles_mailordertext;
echo "<p>";
echo " <a href=\"" . rex_getUrl('','', array('mode'=>'clearbasket')) . "\" title=\"Warenkorb löschen\">Warenkorb löschen</a>";
echo " ";
// echo " <a href=\"" . rex_getUrl('','', array('mode'=>'checkout')) . "\" title=\"Zur Kasse gehen\">Zur Kasse gehen</a>";
echo "</p>";
backToShopLink();
} else {
// echo "<p>Ihr Warenkorb ist leer!</p>";
backToShopLink();
}
echo "</div>";
// Warenkorb einfügen Ende ======================================================================
echo "</div>";
// Ende
}
if ($tvsshop_mode == "showbasket") {
// Warenkorb anzeigen
echo "<div class=\"tvsshop_basket\">";
echo "<h1>Warenkorb</h1>";
if ($_SESSION[$thispage]['cart']['art_id'] != '') {
$articles = explode(",", $_SESSION[$thispage]['cart']['art_id']);
$articles_count = explode(",", $_SESSION[$thispage]['cart']['art_count']);
$articles_sum_count = 0;
$articles_sum = 0;
$articles_ordertext = "";
$articles_mailordertext = "";
$articles_ordertext .= "<table class=\"tvsshop_art_table\" summary=\"Warenkorb\">";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <th class=\"art_col_1\">Titel</th>";
$articles_ordertext .= " <th class=\"art_col_2\">Anzahl</th>";
$articles_ordertext .= " <th class=\"art_col_3\">Einzelpreis</th>";
$articles_ordertext .= " <th class=\"art_col_4\">Summe</th>";
$articles_ordertext .= " <th class=\"art_col_5\"> </th>";
$articles_ordertext .= "</tr>";
$articles_mailordertext .= "Titel" . chr(9) . "Anzahl" . chr(9) . "Summe\n";
$sql = new rex_sql();
foreach ($articles as $i => $value) {
$sql->setQuery("SELECT * FROM " . $art_table . " WHERE id = " . $value . " AND status = 1");
if ($sql->getRows() > 0 )
{
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\"><a href=\"" . $article_url . "\" title=\"" . $sql->getValue('title') . "\">" . $sql->getValue('title') . "</a></td>";
$articles_ordertext .= " <td class=\"art_col_2\">" . $articles_count[$i] . "</td>";
$articles_ordertext .= " <td class=\"art_col_3\">" . sprintf("%01.2f",$sql->getValue('price')) . " " . $currency . "</td>";
$articles_ordertext .= " <td class=\"art_col_4\">" . sprintf("%01.2f",$sql->getValue('price') * doubleval($articles_count[$i])) . " " . $currency . "</td>";
$articles_ordertext .= " <td class=\"art_col_5\"><a href=\"" . rex_getUrl('','', array('mode'=>'delorderpos','art_id'=>$sql->getValue('id'))) . "\" title=\"Artikel entfernen\">entfernen</a></td>";
$articles_sum = $articles_sum + $sql->getValue('price') * doubleval($articles_count[$i]);
$articles_sum_count = $articles_sum_count + doubleval($articles_count[$i]);
$articles_ordertext .= "</tr>";
$articles_mailordertext .= $sql->getValue('title') . chr(9) . $articles_count[$i] . chr(9) . sprintf("%01.2f",$sql->getValue('price') * doubleval($articles_count[$i])) . " " . $currency . "\n";
$sql->next();
}
}
$_SESSION[$thispage]['cart']['art_sumtotal'] = $articles_sum;
if ($mwst <> 0) {
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\">Summe Netto:</td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\">" . sprintf("%01.2f",$articles_sum / $mwstfaktor) . " " . $currency . "</td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\">zzgl. MwSt." . $mwst . "%:</td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\">" . sprintf("%01.2f",$articles_sum - ($articles_sum / $mwstfaktor)) . " " . $currency . "</td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\">Summe Brutto:</td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\"><b>" . sprintf("%01.2f",$articles_sum) . " " . $currency . "</b></td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
}
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\">Versandkosten:</td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\"><b>" . sprintf("%01.2f",$shipping) . " " . $currency . "</b></td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "<tr>";
$articles_ordertext .= " <td class=\"art_col_1\"><b>Gesamtsumme:</b></td>";
$articles_ordertext .= " <td class=\"art_col_2\"> </td>";
$articles_ordertext .= " <td class=\"art_col_3\"> </td>";
$articles_ordertext .= " <td class=\"art_col_4\"><b>" . sprintf("%01.2f",$articles_sum + $shipping) . " " . $currency . "</b></td>";
$articles_ordertext .= " <td class=\"art_col_5\"> </td>";
$articles_ordertext .= "</tr>";
$articles_ordertext .= "</table>";
$articles_mailordertext .= "Versandkosten" . chr(9) . chr(9) . sprintf("%01.2f",$shipping) . " " . $currency . "\n";
$articles_mailordertext .= "Gesamt:" . chr(9) . $articles_sum_count . chr(9) . sprintf("%01.2f",$articles_sum + $shipping) . " " . $currency . "\n";
echo $articles_ordertext;
$_SESSION['tvsshop']['cart']['mailordertext'] = $articles_mailordertext;
echo "<p>";
echo " <a href=\"" . rex_getUrl('','', array('mode'=>'clearbasket')) . "\" title=\"Warenkorb löschen\">Warenkorb löschen</a>";
echo " ";
echo " <a href=\"" . rex_getUrl('','', array('mode'=>'checkout')) . "\" title=\"Zur Kasse gehen\">Zur Kasse gehen</a>";
echo "</p>";
backToShopLink();
} else {
echo "<p>Ihr Warenkorb ist leer!</p>";
backToShopLink();
}
echo "</div>";
} elseif ($tvsshop_mode == "" && $tvsshop_art_id == -1) {
// Normale Artikelübersicht...
//
// ..Link für Warenkorb anzeigen
if ($_SESSION[$thispage]['cart']['art_id'] != "")
$articles = explode(",", $_SESSION[$thispage]['cart']['art_id']);
else
$articles = array();
echo "<div class=\"tvsshop_showbasket\">";
//showBasketLink();
if (count($articles) > 0) {
$articles_count = 0;
$articles_count = explode(",", $_SESSION['tvsshop']['cart']['art_count']);
$articles_sum_count = 0;
if ($articles_count > 0) {
foreach ($articles_count as $i => $value) {
$articles_sum_count = $articles_sum_count + doubleval($value);
}
}
echo "[<a href=\"" . rex_getUrl('','', array('mode'=>'showbasket')) . "\" title=\"Warenkorb anzeigen\">Warenkorb (" . $articles_sum_count . " Artikel)</a>] ";
echo "[<a href=\"" . rex_getUrl('','', array('mode'=>'checkout')) . "\" title=\"Zur Kasse gehen\">Zur Kasse gehen</a>]";
}
echo "</div>";
$sql = new rex_sql();
$sql->setQuery("SELECT * FROM " . $art_table . " WHERE status = 1 " . $tvssql . " ORDER BY " . $sql_sort . $tvsshop_asc);
$total_rows = $sql->getRows();
$sql->setQuery("SELECT * FROM " . $art_table . " WHERE status = 1 " . $tvssql . " ORDER BY " . $sql_sort . $tvsshop_asc . " " . $sql_limit);
if ($sql->getRows() > 0 ) {
for ($i = 1; $i <= $sql->getRows(); $i++) {
if (OOAddon :: isAvailable('rexseo') || OOAddon :: isAvailable('seo42'))
$article_url = getTvsShopUrl($sql->getValue('id'), $REX['CUR_CLANG']);
else
$article_url = rex_getUrl('','', array('art_id'=>$sql->getValue('id')));
$art_href = "<a href=\"" . $article_url . "\" title=\"" . $sql->getValue('title') . "\">";
echo "<div class=\"tvsshop_article\">";
if ($sql->getValue('filelist') != "") {
$art_images = explode(",",$sql->getValue('filelist'));
if ($imagesize != "")
if (OOAddon::isAvailable("image_resize"))
echo $art_href . "<img src=\"index.php?rex_resize=" . $imagesize . "w__" . $art_images[0] . "\" alt=\"" . $sql->getValue('title') . "\" title=\"" . $sql->getValue('title') . "\" /></a>";
else
echo $art_href . "<img src=\"files/" . $art_images[0] . "\" style=\"width:" . $imagesize . "px;\" alt=\"" . $sql->getValue('title') . "\" title=\"" . $sql->getValue('title') . "\" /></a>";
else
echo $art_href . "<img src=\"files/$art_images[0]\" alt=\"" . $sql->getValue('title') . "\" title=\"" . $sql->getValue('title') . "\" /></a>";
}
if ($sql->getValue('title') != "")
echo "<p class=\"art_title\">" . $art_href . $sql->getValue('title') . "</a></p>";
if ($sql->getValue('description') != "") {
echo "<p class=\"art_description\">";
$tvsoutput = $sql->getValue('description');
$article = new rex_article();
echo $article->replaceLinks($tvsoutput);
echo "</p>";
}
if ($sql->getValue('price') != "") {
echo "<p class=\"art_price\">Preis: " . sprintf("%01.2f",$sql->getValue('price')) . " " . $currency . "</p>";
}
echo " <div class=\"art_addtocart\">";
echo " <p>";
// echo " <form name=\"art_addtocart_\" method=\"post\" action=\"" . rex_getUrl('','', array('mode'=>'addtocart')) . "\">";
echo " <form name=\"art_addtocart_" . $sql->getValue('id') . "\" method=\"get\" action=\"" . rex_getUrl('') . "\">";
echo " <input type=\"hidden\" name=\"mode\" id=\"mode\" value=\"addtocart\" />";
echo " <input type=\"hidden\" name=\"art_id\" id=\"art_id\" value=\"" . $sql->getValue('id') . "\" />";
echo " <input class=\"art_input_text\" type=\"text\" name=\"art_count\" id=\"count" . $sql->getValue('id') . "\" value=\"1\" /> ";
echo " <input class=\"art_input_submit\" type=\"submit\" name=\"art_input_submit\" id=\"art_input_submit_" . $sql->getValue('id') . "\" value=\"In den Warenkorb\" />";
echo" </form>";
echo " </p>";
echo " </div>";
if ($usefacebook == "1") {
$url = urlencode("http://".$_SERVER["SERVER_NAME"] . $article_url);
?>
<div style="text-align:left; padding-top: 10px;">
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $url; ?>&layout=button_count&action=recommend" scrolling="no" frameborder="0" style="border:none; width:500px; height: 50px;"></iframe>
</div>
<?php
}
if ($sql->getValue('keywords') != "") {
echo " <div class=\"art_tags\">";
echo " <h5>Schlagworte:</h5>";
$tags = explode(",", $sql->getValue('keywords'));
$tags_out = "";
foreach ($tags as $value) {
$tags_out .= "<a href='" . rex_getUrl('','', array('tag'=>trim($value))) . "'>$value</a>, ";
}
$tags_out = substr($tags_out, 0, - 2);
echo $tags_out;
echo " </div>";
}
echo "</div>";
$sql->next();
}
if ($tvsshop_start > 0) {
echo "<div class=\"tvsshop_navigation\">";
echo " <a href=\"" . rex_getUrl($article_id,'', array('tvsshop_start'=>trim($tvsshop_start - $tvsshop_limit), 'tvsshop_cat'=>trim($tvsshop_cat))) . "\">« Vorige Beiträge</a>";
echo "</div>";
}
if (($tvsshop_start + $tvsshop_limit) < $total_rows) {
echo "<div class=\"tvsshop_navigation\">";
echo " <a href=\"" . rex_getUrl($article_id,'', array('tvsshop_start'=>trim($tvsshop_start + $tvsshop_limit), 'tvsshop_cat'=>trim($tvsshop_cat))) . "\">Nächste Beiträge »</a>";
echo "</div>";
}
}
} elseif ($tvsshop_mode == "" && $tvsshop_art_id <> -1) {
// Einzel-Artikelübersicht...
//
// ..Link für Warenkorb anzeigen
if ($_SESSION[$thispage]['cart']['art_id'] != "")
$articles = explode(",", $_SESSION[$thispage]['cart']['art_id']);
else
$articles = array();
echo "<div class=\"tvsshop_showbasket\">";
//showBasketLink();
if (count($articles) > 0) {
$articles_count = 0;
$articles_count = explode(",", $_SESSION['tvsshop']['cart']['art_count']);
$articles_sum_count = 0;
if ($articles_count > 0) {
foreach ($articles_count as $i => $value) {
$articles_sum_count = $articles_sum_count + doubleval($value);
}
}
echo "[<a href=\"" . rex_getUrl('','', array('mode'=>'showbasket')) . "\" title=\"Warenkorb anzeigen\">Warenkorb (" . $articles_sum_count . " Artikel)</a>] ";
echo "[<a href=\"" . rex_getUrl('','', array('mode'=>'checkout')) . "\" title=\"Zur Kasse gehen\">Zur Kasse gehen</a>]";
}
echo "</div>";
$sql = new rex_sql();
$sql->setQuery("SELECT * FROM " . $art_table . " WHERE status = 1 " . $tvssql . " ORDER BY " . $sql_sort . $tvsshop_asc);
$total_rows = $sql->getRows();
$sql->setQuery("SELECT * FROM " . $art_table . " WHERE status = 1 " . $tvssql . " ORDER BY " . $sql_sort . $tvsshop_asc . " " . $sql_limit);
if ($sql->getRows() > 0 ) {
if (OOAddon :: isAvailable('rexseo') || OOAddon :: isAvailable('seo42'))
$article_url = getTvsShopUrl($sql->getValue('id'), $REX['CUR_CLANG']);
else
$article_url = rex_getUrl('','', array('art_id'=>$sql->getValue('id')));
$art_href = "<a href=\"" . $article_url . "\" title=\"" . $sql->getValue('title') . "\">";
echo "<div class=\"tvsshop_article\">";
if ($sql->getValue('filelist') != "") {
$art_images = explode(",",$sql->getValue('filelist'));
if ($imagesize != "")
if (OOAddon::isAvailable("image_resize"))
echo $art_href . "<img src=\"index.php?rex_resize=" . $imagesize . "w__" . $art_images[0] . "\" alt=\"" . $sql->getValue('title') . "\" title=\"" . $sql->getValue('title') . "\" /></a>";
else
echo $art_href . "<img src=\"files/" . $art_images[0] . "\" style=\"width:" . $imagesize . "px;\" alt=\"" . $sql->getValue('title') . "\" title=\"" . $sql->getValue('title') . "\" /></a>";
else
echo $art_href . "<img src=\"files/$art_images[0]\" alt=\"" . $sql->getValue('title') . "\" title=\"" . $sql->getValue('title') . "\" /></a>";
}
if ($sql->getValue('title') != "")
echo "<p class=\"art_title\">" . $art_href . $sql->getValue('title') . "</a></p>";
if ($sql->getValue('description') != "") {
echo "<p class=\"art_description\">";
$tvsoutput = $sql->getValue('description');
$article = new rex_article();
echo $article->replaceLinks($tvsoutput);
echo "</p>";
}
if ($sql->getValue('price') != "") {
echo "<p class=\"art_price\">Preis: " . sprintf("%01.2f",$sql->getValue('price')) . " " . $currency . "</p>";
}
echo " <div class=\"art_addtocart\">";
echo " <p>";
// echo " <form name=\"art_addtocart_form\" method=\"post\" action=\"" . rex_getUrl('','', array('mode'=>'addtocart')) . "\">";
echo " <form name=\"art_addtocart_" . $sql->getValue('id') . "\" method=\"get\" action=\"" . rex_getUrl('','','') . "\">";
echo " <input type=\"hidden\" name=\"mode\" value=\"addtocart\" />";
echo " <input type=\"hidden\" name=\"art_id\" value=\"" . $sql->getValue('id') . "\" />";
echo " <input class=\"art_input_text\" type=\"text\" name=\"art_count\" id=\"count" . $sql->getValue('id') . "\" value=\"1\" /> ";
echo " <input class=\"art_input_submit\" type=\"submit\" name=\"art_input_submit\" id=\"art_input_submit_" . $sql->getValue('id') . "\" value=\"In den Warenkorb\" />";
echo " </form>";
echo " </p>";
echo " </div>";
if ($usefacebook == "1") {
$url = urlencode("http://".$_SERVER["SERVER_NAME"] . rex_getUrl('','', array('art_id'=>$sql->getValue('id'))));
?>
<div style="text-align:left; padding-top: 10px;">
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $url; ?>&layout=button_count&action=recommend" scrolling="no" frameborder="0" style="border:none; width:500px; height: 50px;"></iframe>
</div>
<?php
}
if ($sql->getValue('keywords') != "") {
echo " <div class=\"art_tags\">";
echo " <h5>Schlagworte:</h5>";
$tags = explode(",", $sql->getValue('keywords'));
$tags_out = "";
foreach ($tags as $value) {
$tags_out .= "<a href='" . rex_getUrl('','', array('tag'=>trim($value))) . "'>$value</a>, ";
}
$tags_out = substr($tags_out, 0, - 2);
echo $tags_out;
echo " </div>";
}
echo "</div>";
}
}
?>