ecshop每个商品添加最少购买量最小订购量
2016-07-07 14:55 来源:www.chinab4c.com 作者:ecshop专家
第一步,商品表必须有个字段代表某个商品 最小订购数量->min_number 打开goods表在最后字段添加一个min_numbertinyint类型 默认值为0代表没有最小起订量 sql:alter table `goods` add column `min_number` tinyint (3) UNSIGNEDDEFAULT '0' NOT NULLafter `warn_number` 第二部,在后台添加商品的时候 必须有个text文本框设置最小起订量 admin/goods.php 在'warn_number'=> 1 , 代码行后插入'min_number'=> 0, 在$warn_number = isset($_POST['warn_number']) ? $_POST['warn_number'] : 0; 后添加代码$min_number = isset($_POST['min_number']) ? $_POST['min_number'] : 0; 第三部 修改添加商品sql语句 修改代码 if ($is_insert){ if ($code == ''){ $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, " . "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " . "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img,keywords, goods_brief, " . "seller_note, goods_weight, goods_number, warn_number,min_number, integral,give_integral, is_best, is_new, is_hot, ". "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type,rank_integral)" . "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " . "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ". "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb', '$original_img', ". "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight','$goods_number',". "'$warn_number','$min_number', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', '$is_on_sale', '$is_alone_sale', ". "'$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type','$rank_integral')"; }else{ $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name, goods_name_style, goods_sn, ". "cat_id, brand_id, shop_price, market_price, is_promote, promote_price, " . "promote_start_date, promote_end_date, goods_img, goods_thumb, original_img,keywords, goods_brief, " . "seller_note, goods_weight, goods_number, warn_number, min_number,integral,give_integral, is_best, is_new, is_hot, is_real, " . "is_on_sale, is_alone_sale, goods_desc, add_time, last_update, goods_type,extension_code, rank_integral)" . "VALUES ('$_POST[goods_name]', '$goods_name_style', '$goods_sn', '$catgory_id', " . "'$brand_id', '$shop_price', '$market_price', '$is_promote','$promote_price', ". "'$promote_start_date', '$promote_end_date', '$goods_img', '$goods_thumb','$original_img', ". "'$_POST[keywords]', '$_POST[goods_brief]', '$_POST[seller_note]', '$goods_weight','$goods_number',". " '$warn_number','$min_number', '$_POST[integral]', '$give_integral', '$is_best','$is_new', '$is_hot', 0, '$is_on_sale', '$is_alone_sale’' ". " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral')"; } }else{ $sql = "SELECT goods_thumb, goods_img, original_img " . " FROM " . $ecs->table('goods') . " WHERE goods_id = '$_REQUEST[goods_id]'"; $row = $db->getRow($sql); if ($proc_thumb && $goods_img && $row['goods_img'] && !goods_parse_url($row['goods_img'])) { @unlink(ROOT_PATH . $row['goods_img']); @unlink(ROOT_PATH . $row['original_img']); } if ($proc_thumb && $goods_thumb && $row['goods_thumb'] && !goods_parse_url($row['goods_thumb'])) { @unlink(ROOT_PATH . $row['goods_thumb']); } $sql = "UPDATE " . $ecs->table('goods') . " SET " . "goods_name = '$_POST[goods_name]', " . "goods_name_style = '$goods_name_style', " . "goods_sn = '$goods_sn', " . "cat_id = '$catgory_id', " . "brand_id = '$brand_id', " . "shop_price = '$shop_price', " . "market_price = '$market_price', " . "is_promote = '$is_promote', " . "promote_price = '$promote_price', " . "promote_start_date = '$promote_start_date', " . "promote_end_date = '$promote_end_date', "; if ($goods_img) { $sql .= "goods_img = '$goods_img', original_img = '$original_img', "; } if ($goods_thumb) { $sql .= "goods_thumb = '$goods_thumb', "; }rnbylc63.com jbylc29.com lsylc269.com hqylc218.com zfylc46.com |
最近更新
常用插件
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...
ecshop热门问答
ecshop热门资料
ecshop邮件群发管理
ecshop工作量
ecshop上传图片的方法
ecshop想赚钱
ecshop忙活
ecshop手写输入
ecshopvjia模板
javaecshop
ecshop已确认
ecshop双引号
ecshop日程
ecshop首选
ecshop如何调整大小
ecshop3个空白
ecshopbluceoean
ecshopECShopB2C
ecshop公司简介
ecshop课程
ecshop团购价格
ecshop不能创建产品
ecshop诡异
ecshop延时
ecshop新安裝
ecshopdisplay
ecshopjquery冲突
ecshopdigit;模版;底色
ecshop女孩
ecshopPHPer
ecshop三级菜单
ecshop非会员