0
我正在爲攝影業務創建一個PHP購物車。這是第一個電子商務網站,我已經嘗試(新手)PHP購物車 - 添加變量
我已成功將產品添加到購物車(保存在session) (產品:打印,鑰匙扣,磁鐵ECT)
但是我還需要以圖像標識添加到會話
這裏是我的代碼
$product_id = $_GET[id]; //the product id from the URL
$imageId = $_GET[imageid]; //the image id from the URL
$action = $_GET[action]; //the action from the URL
switch($action) { //decide what to do
case "add":
$_SESSION['cart'][$product_id]++; //add one to the quantity of the product with id $product_id
break;
的cart.php URL被示出爲:
cart.php圖像標識= 83 & ID = 12 &行動=添加
任何人都可以幫助/指教我怎樣添加圖片ID到產品?
謝謝
通過_「將圖像ID添加到產品中」_是否將它存儲在會話中或將圖像顯示在籃子中? –
我的意思是兩個...... – Shane
你可以顯示生成籃子標記的代碼嗎? –