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
你可以显示生成篮子标记的代码吗? –