ecshop 在商品类表页添加类似于精品的自定义字段.doc_第1页
ecshop 在商品类表页添加类似于精品的自定义字段.doc_第2页
ecshop 在商品类表页添加类似于精品的自定义字段.doc_第3页
ecshop 在商品类表页添加类似于精品的自定义字段.doc_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

目前在做自己的博客爱T-blog web开发、分享 与爱T们技术交流在商品列表页添加自定义字段(爱T-blog)1、首先要修改数据表结构,给表 ecs_goods 增加新字段:other_col,进入ECSHOP后台 数据库管理 SQL查询,输入下面SQL语句,提交。注意如果你的数据表前缀不是ecs_ 请自行修改之alter table ecs_goods add column other_col varchar(64);2. 打开admin/goods.php在/* 处理商品数据 */那里$is_hot = isset($_POSTis_hot) ? 1 : 0;(大约803行)$other_col = isset($_POSTother_col) ? 1 : 0;在 /* 入库 */添加/* 入库 */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, is_best, is_new, is_hot, other_col,” .“is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, rank_integral, suppliers_id)” .“VALUES ($_POSTgoods_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, “.“$_POSTkeywords, $_POSTgoods_brief, $_POSTseller_note, $goods_weight, $goods_number,”.” $warn_number, $_POSTintegral, $give_integral, $is_best, $is_new, $is_hot,$other_col, $is_on_sale, $is_alone_sale, $is_shipping, “.” $_POSTgoods_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, other_col,is_real, ” .“is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, extension_code, rank_integral)” .“VALUES ($_POSTgoods_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, “.“$_POSTkeywords, $_POSTgoods_brief, $_POSTseller_note, $goods_weight, $goods_number,”.” $warn_number, $_POSTintegral, $give_integral, $is_best, $is_new, $is_hot,$other_col, 0, $is_on_sale, $is_alone_sale, $is_shipping, “.” $_POSTgoods_desc, ” . gmtime() . “, ”. gmtime() .”, $goods_type, $code, $rank_integral)”;在 /* 如果有上传图片,需要更新数据库 */$sql .= “keywords = $_POSTkeywords, ” .“goods_brief = $_POSTgoods_brief, ” .“seller_note = $_POSTseller_note, ” .“goods_weight = $goods_weight,” .“goods_number = $goods_number, ” .“warn_number = $warn_number, ” .“integral = $_POSTintegral, ” .“give_integral = $give_integral, ” .“rank_integral = $rank_integral, ” .“is_best = $is_best, ” .“is_new = $is_new, ” .“other_col = $other_col, ” .“is_hot = $is_hot, ” .“is_on_sale = $is_on_sale, ” .“is_alone_sale = $is_alone_sale, ” .“is_shipping = $is_shipping, ” .“goods_desc = $_POSTgoods_desc, ” .“last_update = ”. gmtime() .”, “.“goods_type = $goods_type ” .“WHERE goods_id = $_REQUESTgoods_id LIMIT 1;在 /* 取消新品 */后添加/* 设为other_col */elseif ($_POSTtype = other_col)/* 检查权限 */admin_priv(goods_manage);update_goods($goods_id, other_col, 1);/* 取消other_col */elseif ($_POSTtype = not_other_col)/* 检查权限 */admin_priv(goods_manage);update_goods($goods_id, other_col, 0);在 / 修改新品推荐状态后面/* */ 修改other_col推荐状态/* */elseif ($_REQUESTact = toggle_other_col)check_authz_json(goods_manage);$goods_id = intval($_POSTid);$other_col = intval($_POSTval);if ($exc-edit(“other_col = $other_col, last_update=” .gmtime(), $goods_id)clear_cache_files();make_json_result($other_col);3.admin/templates/goods_info.htm搜索is_new在$lang.is_hot后面添加 other_col在大约204行$lang.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论