Jump to content


This topic is now archived and is closed to further replies.


Help me please with basket cart

Recommended Posts

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
if(ereg("sc_session.php", $PHP_SELF))
header("location: index.php");
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
include "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>";
$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;
$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;

//note that i'm make the web based book shop:
Kode_Produk = product id
Nama_Produk = product name
Nama_Penulis = writer name
Jumlah_Produk = quantity from the product
Harga_Produk = Product cost
Jumlah_Harga = Total Cost

My 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

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.