关于通用信息修改的方法(适合初学者 大侠就滤过吧~)
2016-07-07 15:03 来源:www.chinab4c.com 作者:ecshop专家
如果想修改后台,主要修改的是模版文件夹中的.htm文件(即位置为:/admin/templates) 今天主要修改的是: 商品管理中心---à添加单个商品和修改单个商品信息 主要实现在通用信息中添加一个属性条形码 1首先找到/admin/templates/good_info.htm 添加 <tr> <td class="label">{$lang.lab_goods_barcode}</td> <td><input type="text" name="goods_barcode" value="{$goods.goods_barcode|escape}" size="30" /></td> </tr> 增加一个内容框,如下: 2语言包里添加 :languages/zh_ch/admin/goods.php 3.修改/admin/goods.php 找到 /* 处理商品数据 */ a.获取good_info.htm 传过来的goods_barcode 变量; b.修改sql语句; /* 入库 */ /*添加了条形码字段goods_barcode */ 在其下的insert语句添加相应的变量 在其下的update也加上; 4.然后在数据库中的goods表中添加相应的字段就OK 了 |
回答:
http://bbs.ecshop.com/viewthread ... mp;page=1#pid492844 看我这个详细一点吧,希望大家做教程尽量的详细,这样才方便新手来学习。 |
很详细 顶了~~ 2# l0ss |
支持下~ |
这个很好啊 |
不错 支持下 |
应人需要补充如下: 3.修改/admin/goods.php 找到 /* 处理商品数据 */ a.获取good_info.htm 传过来的goods_barcode 变量; b.修改sql语句; 1)在其下的insert语句添加相应的变量,找到如下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, integral, give_integral, goods_barcode,is_best, is_new, is_hot, " . "is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, rank_integral, suppliers_id)" . "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', '$_POST[integral]', '$give_integral','$goods_barcode', '$is_best', '$is_new', '$is_hot', '$is_on_sale', '$is_alone_sale', $is_shipping, ". " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id')"; } 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, integral, give_integral, is_best, is_new, is_hot, is_real, " . "is_on_sale, is_alone_sale, is_shipping, 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', '$_POST[integral]', '$give_integral', '$is_best', '$is_new', '$is_hot', 0, '$is_on_sale', '$is_alone_sale', $is_shipping, ". " '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral')"; } 2)在其下的update也加上; 查找 @unlink(ROOT_PATH . $row['goods_thumb']); 添加字段goods_barcode $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', " . "goods_barcode= '$goods_barcode', ". "market_price = '$market_price', " . "is_promote = '$is_promote', " . "promote_price = '$promote_price', " . "promote_start_date = '$promote_start_date', " . "suppliers_id = '$suppliers_id', " . "promote_end_date = '$promote_end_date', "; 4.然后在数据库中的goods表中添加相应的字段就OK 了 添加字段看你用什么了, 可以用sql,也可以工具直接添加。, |
要是前台是条码图象状态显示,那就更拽了 |
最近更新
常用插件
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
- ecshop2.7.1打印发货单插件
ecshop2.7.1打印发货单插件介绍:ecshop2.7.1和以前的ecshop版本不一样,ecs...
- ecshop分类批量扩展插件
ecshop分类批量扩展插件,这个插件是ecshop插件里面比较核心的插件。我们...
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop二次开发详细页面生
插件介绍: ECSHOP系统,在很多时候,很多商品没有人购买,不但购买的人...
ecshop热门问答
ecshop热门资料
ecshop大类
ecmall订购
ecshop命名
ecshop套路
ecshop图片批量处理
ecshop进行
ecshop个性安全套
ecshop大气
ecshop单位换算
ecshop底部信息
ecshop收钱
ecshop前台显示库存
ecshop商品品牌
ecshop求新
ecshop运费计算错误
ecshop关键字
ecshop图片显示
ecshop快照
zen cart商城程序
ecshop详细信息
ecshop装箱单
ecshop红帽
ecshop项目
ecshop请多多帮助
python
ecshop连接数据库
ecshop实验品
HDWiki
ecshop创建
电子商务原创