Kann ich den Warenkorb irgendwie global anzeigen?
Warenkorb
- CRUZ3R
- Thread is marked as Resolved.
Aktuell führen wir noch einige Anpassungen durch, das Forum wurde jedoch bereits live geschaltet.
-
-
Ja dazu die Foren Suche verwenden oder aber hier ein Beispiel Code:
[php]
$past = time()-6400;
$ip = $_SERVER["REMOTE_ADDR"];
if ($cookie[1] != "" AND is_member($member)) {
if ($cookie[6] > 0) {
$memname = "$ip";
}else{
$memname = "$cookie[1]";
}
}else{
$memname = "$ip";
}
$b = 0;
$counter = 0;
$totalprice = 0;
$sql = "SELECT * FROM ".$prefix."_shop_basket WHERE member='$memname' ORDER BY time ASC";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) {
$prodstats = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_shop_products WHERE id='$row[prodid]' AND active='1'"));
$prodpercent = 0;
$prodmoney = 0;
$counter++;
$prodvari = preg_replace('/\r\n|\r|\n/', "{TD}", $row[prodvari]);
$prodvari = explode("{TD}",$prodvari);
for ($j=0; $j<count($prodvari); $j++) {
$prodvaristats = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_shop_prodvari WHERE id='$prodvari[$j]' AND active='1'"));
$varistats = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_shop_variation WHERE id='$prodvaristats[varid]' AND active='1'"));
$varicatstats = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_shop_varicat WHERE id='$varistats[catid]' AND active='1'"));
if ($varicatstats[paymonths] == 1) {
$paymonths = "$varistats[title]";
if ($varicatstats[status] == 1) {
$paymonthsstat = 1;
$paymonthspercent = $prodvaristats[monper];
}else{
$paymonthsstat = 0;
$paymontsmoney = $prodvaristats[monper];
}
}else{
if ($varicatstats[status] == 1) {
$prodpercent = $prodpercent + $prodvaristats[monper];
}else{
$prodmoney = $prodmoney + $prodvaristats[monper];
}
}
if ($prodvaristats[monper] >= 0) {
$monper = number_format($prodvaristats[monper],2,",",".");
$monper = str_replace(".","",$monper);
$monper = "+$monper";
}else{
$monper = number_format($prodvaristats[monper],2,",",".");
$monper = str_replace(".","",$monper);
}
}
$allprice = $prodstats[price] + $prodmoney;
$allprice = $allprice * $prodpercent / 100 + $allprice;
$paymonths = explode(' ',$paymonths);
if ($paymonths[0] > 0) {
$allprice = $allprice * $paymonths[0];
}
if ($paymonthsstat == 1) {
$allprice = $allprice * $paymonthspercent / 100 + $allprice;
}else{
$allprice = $paymontsmoney + $allprice;
}
$onlyprice = $allprice;
$allprice = $allprice * $row[prodcount];
$totalprice = $totalprice + $allprice;
$onlyprice = number_format($onlyprice,2,",",".");
$allprice = number_format($allprice,2,",",".");
}
if ($cmsoption[active] == 1 AND $cmsoption[currencycalc] > 0) {
$totalpricetwo = $totalprice * $cmsoption[currencycalc];
$totalprice = number_format($totalprice,2,",",".");
$totalpricetwo = number_format($totalpricetwo,2,",",".");
}else{
$totalprice = number_format($totalprice,2,",",".");
}
if ($language == "german" OR $language == "") {
echo 'Artikel im Warenkorb: '.$urow.'<br><br>
Zwischensumme: '.$totalprice.' '.$cmsoption[short].'';
}else{
echo 'Products: '.$urow.'<br><br>
Subtotal: '.$totalprice.' '.$cmsoption[short].'';
}
if ($cmsoption[active] == 1 AND $cmsoption[currencycalc] > 0) {
echo ' / '.$totalpricetwo.' '.$cmsoption[shorttwo].'';
}
if ($language == "german" OR $language == "") {
echo ' <div class="small">Preis inkl. Mwst.<br>Zum Warenkorb';
}else{
echo ' <div class="small">price incl. VAT<br>Basket';
}[/php]