Hi,
Ik ben bezig met een winkelmand, maar hij moet het totale bedrag berekenen.
Maar dat doet hij niet, weet iemand een oplissing?
Gegroet
Ik ben bezig met een winkelmand, maar hij moet het totale bedrag berekenen.
Maar dat doet hij niet, weet iemand een oplissing?

$winkelmandQuery = $core->mysql->query("SELECT
p.naam,
p.afbeelding_klein,
p.prijs,
COUNT(p.id) AS aantal_producten
FROM
producten p,
winkelmandje w
WHERE
w.artikel_id = p.id
AND
w.lid_id = ".$core->leden->info[mijn][id]."
GROUP BY
p.id");
if($core->mysql->num_rows($winkelmandQuery) >= 1)
{
?>
<div id=winkelmand>
<span>Op dit moment bevinden zich de volgende producten in uw winkelmandje:</span>
<table width=700px border=0 cellpadding=0 cellspacing=0>
<tr>
<td class=table_top><b>Afbeelding:</b></td>
<td class=table_top><b>Productnaam:</b></td>
<td class=table_top><b>Aantal:</b></td>
<td class=table_top><b>Prijs:</b></td>
</tr>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$winkelmandFetch[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$winkelmandQuery[/COLOR][COLOR= #007700]))
{[/COLOR]
?>
<tr>
<td><img src=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] _ROOT_[COLOR= #007700];[/COLOR] ?>images/producten/[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]entities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$winkelmandFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]afbeelding_klein[/COLOR][COLOR= #007700]]);[/COLOR] ?> alt= style=margin-left:40px; /></td>
<td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]entities[COLOR= #007700]([/COLOR][URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$winkelmandFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]afbeelding_klein[/COLOR][COLOR= #007700]]));[/COLOR] ?></td>
<td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$winkelmandFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantal_producten[/COLOR][COLOR= #007700]];[/COLOR] ?>x</td>
<td class=table_right>€[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]entities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$winkelmandFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]prijs[/COLOR][COLOR= #007700]]);[/COLOR] ?></td>
</tr>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
</table>
[COLOR= #0000BB]<?php
$prijsQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT
p.prijs
FROM
winkelmandje w,
producten p
WHERE
w.lid_id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]info[COLOR= #007700][[/COLOR][COLOR= #DD0000]mijn[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"
AND
w.artikel_id = p.id"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$prijsFetch[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$prijsQuery[/COLOR][COLOR= #007700]);[/COLOR]
?>
<div id=prijs>
<span>Totaal aantal producten:</span><span style=float:right;>1</span>
<span>Totaal bedrag:</span><span style=float:right;>€[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$prijsFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]prijs[/COLOR][COLOR= #007700]];[/COLOR] ?></span>
<a href= class=button>verwijderen</a><a href= style=float: right; class=button>afrekenen</a></span>
</div>
</div> Gegroet

