fadyz Posted September 9, 2006 Share Posted September 9, 2006 I've build a simple web e-commerce and i've stuck in basket cart page. I'm confused how to edit and delete the item that exist in basket cart. I've have this code ://sc_session.php for hold the session variable<?phpif(ereg("sc_session.php", $PHP_SELF)){ header("location: index.php"); die;}session_name("sc");session_start();if(!session_is_registered("Kode_Produk")){ session_register(Kode_Produk, Nama_Produk, Nama_Penulis, Nama_Penerbit, Jumlah_Produk, Harga_Produk, Jumlah_Harga); $Kode_Produk = array(); $Nama_Produk = array(); $Nama_Penulis = array(); $Nama_Penerbit = array(); $Jumlah_Produk = array(); $Harga_Produk = array(); $Jumlah_Harga = array();}?>//sc_basket for showing the item in the basket cart<?phpinclude "sc_session.php";include "template.php";include "rupiah.php";$counter = count($Kode_Produk);if($counter == 0){ $isi .= "<p><div class='bodytext'>Your Basket cart still empty</p>";}else{ $isi = "<div class='bodytext'>"; $isi .= "<b>Basket Cart<p></b>"; $isi .= "Please Look again at your basket cart :<p>"; $isi .= "<table class='bodytext' border='1' align='center' cellspacing='0' cellpadding='2' bordercolorlight='#008000'>"; $isi .= "<tr bgcolor='silver' align='center'><th>No</th><th>Kode Produk</th><th>Nama Produk</th><th>Harga Satuan</th><th>Qty</th><th>Harga</th><th>Edit</th></tr>"; $counter = count($Kode_Produk); $no = 0; $totalharga = 0; for($i=0;$i<$counter;$i++) { $index = $i; $no = $i + 1; $totalharga = $totalharga + $Jumlah_Harga[$i]; $rp_Harga_Produk = rupiah($Harga_Produk[$i]); $rp_Jumlah_Harga = rupiah($Jumlah_Harga[$i]); $isi .= "<tr><td>$no</td><td>$Kode_Produk[$i]</td><td>$Nama_Produk[$i]</td><td align='right'>$rp_Harga_Produk</td><td align='center'>$Jumlah_Produk[$i]</td><td align='right'>$rp_Jumlah_Harga</td>"; } $rp_totalharga = rupiah($totalharga); $isi .= "<tr><td colspan='5'>Total Harga</td><td align='right'>$rp_totalharga</td></tr>"; $isi .= "</table></p>"; $isi .= "<p></div>";}$isi .= "<p>[<a href='product.php?kid=$kid'><span class='tombol'>Back To Shop</span></a>]";$isi .= "<p>";$tpl = new template;$tpl->define_theme("theme01.html");$tpl->define_tag("{ISI}",$isi);$tpl->parse();$tpl->printproses();?>//note that i'm make the web based book shop:Kode_Produk = product idNama_Produk = product nameNama_Penulis = writer nameJumlah_Produk = quantity from the productHarga_Produk = Product costJumlah_Harga = Total CostMy Question is what should i put(PHP code) in the sc_basket.php so i can edit and delete item that i don't want to in my basket cart. Sorry for my bad english T_T Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.