/* 将商品加入购物车 */
2016-07-07 16:49 来源:www.chinab4c.com 作者:ecshop专家
/* 将商品加入购物车 */ $cart_item = array( 'user_id' => $this->visitor->get('user_id'), 'session_id' => SESS_ID, 'store_id'=> $spec_info['store_id'], 'spec_id' => $spec_id, 'goods_id'=> $spec_info['goods_id'], 'goods_name' => addslashes($spec_info['goods_name']), 'specification' => addslashes(trim($specification)), /* 判断用户是否是注册会员而选择写入价格*/ if $visitor.cfa_member=="0" 'price'=> $spec_info['price_all'], else 'price'=> $spec_info['price'] 'quantity'=> $quantity, 'goods_image'=> addslashes($spec_info['default_image']), ); 这样写对吗?不会PHP。语法有问题吗? |
回答:
搞定了。。。 /* 将商品加入购物车 */ if ($this->visitor->get('cfa_member') != '0' and $this->visitor->get('cfa_member')> '0') { $price_temp= $spec_info['price']; } else { $price_temp= $spec_info['price_all']; } $cart_item = array( 'user_id' => $this->visitor->get('user_id'), 'session_id' => SESS_ID, 'store_id'=> $spec_info['store_id'], 'spec_id' => $spec_id, 'goods_id'=> $spec_info['goods_id'], 'goods_name' => addslashes($spec_info['goods_name']), 'specification' => addslashes(trim($specification)), 'price'=> $price_temp, /*'price'=> $spec_info['price_all'],*/ 'quantity'=> $quantity, 'goods_image'=> addslashes($spec_info['default_image']), ); |
最近更新
常用插件
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop根据订单批量发红包
ecshop根据订单批量发红包 ,大家肯定对ecshop红包不陌生,但是对ecshop订...
- ecshop 手机注册验证插件
ecshop 手机注册验证插件 ,需要通过手机获短信,然后注册验证 价格:...
- ecshop使用手机验证码登陆
ecshop使用手机验证码登陆,这个功能很新颖,有些特殊的ecshop站点,他到...
- ecshop中nginx实现url的重写
上几章为了让ecshop很好的在nginx上运行。我们搭配了ecshop的nginx下的工作...
ecshop热门问答
ecshop热门资料
ecshopallocate
ecshop提货卡
ecshop英文版
mongodb
Editable
ecshop收件人
ecshop代码修改
ecshop实时
ecshop大洋
ecshop购物车强化
ecshopIncorrect
ecshop顶层
ecshop雪地
ecshopproducts
ecshop支付方式类
ecshopexists
ecshop回答
输出ecshop数据
ecshopfirewall
ecshop等待处理
ecshop说明书
ecshop多样
ecshop文件传不上
ecshop老大
ecshop居然
ecshop唱片
ecshop二级域名
ecshop间歇性
ecshop微录手表
ecshop导航站