ecshop如何增加多个产品详细描述的编辑器
在做商产品详情的时候,经常会有选项卡类似的几个产品说明,如:商品详情,商品规格,参数列表,售后服务等。
Ecshop后台里面默认只有一个编辑框(器),那么我们还得自己添加几个,以下是ecshop如何增加产品描述编辑器个数的步骤:
1)在数据库的表esc_goods里增加二个text的字段用来存储新增的二个编辑框的内容,
如:goods_desc2,goods_desc3(可以用phpmyadmin)
2)修改生成编辑器的函数 找到 /admin/includes/lib_main.php 文件
将
function create_html_editor($input_name, $input_value = '')
修改为
function create_html_editor($input_name, $input_value = '',$fckid=0)
继续向下找到
$smarty->assign('FCKeditor', $FCKeditor);
将它修改为
if ($fckid)
{
$smarty->assign('FCKeditor'.$fckid, $FCKeditor);
}
else
{
$smarty->assign('FCKeditor', $FCKeditor);
}
3)接下来要修改后台商品处理页 /admin/goods.php 文件
找到 create_html_editor('goods_desc', $goods['goods_desc']);
在它下面另添加2行
create_html_editor('goods_desc2', $goods['goods_desc2'],2);
create_html_editor('goods_desc3', $goods['goods_desc3'],3);
4)最后修改一下对应的后台显示文件 /admin/templates/goods_info.htm
找到下面这些代码
<table width="90%" id="detail-table" style="display:none">
<tr>
<td>{$FCKeditor}</td>
</tr>
</table>
在下面复制粘贴2个并把(包括原来一个)这三个表格代码修改为
<table width="90%" id="detail-table" style="display:none">
<tr>
<td width="80" align="right">商品详情:</td>
<td>{$FCKeditor}</td>
</tr>
</table>
<table width="90%" id="desc2-table" style="display:none">
<tr>
<td width="80" align="right">售后服务:</td>
<td>{$FCKeditor2}</td>
</tr>
</table>
<table width="90%" id="desc3-table" style="display:none">
<tr>
<td width="80" align="right">买家必读:</td>
<td>{$FCKeditor3}</td>
</tr>
</table>
修改顶部的导航:
找到<span class="tab-back" id="detail-tab">{$lang.tab_detail}</span>
后面加入
<span class="tab-back" id="desc2-tab">desc2</span>
<span class="tab-back" id="desc3-tab">desc3</span>
5)最后修改内容存储进数据库的文件,打开 /admin/goods.php
1> 找到如下代码:
$sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name,goods_model, 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_home, is_on_sale, is_alone_sale, is_shipping, goods_desc
在后面加上 ,goods_desc2 ,goods_desc3 即如下代码 $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name,goods_model, 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_home, is_on_sale, is_alone_sale, is_shipping, goods_desc,goods_desc2 ,goods_desc3
在下面几行,同理找到
"VALUES ('$_POST[goods_name]','$_POST[goods_model]', '$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', '$is_home', '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id')"
改为: "VALUES ('$_POST[goods_name]','$_POST[goods_model]', '$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', '$is_home', '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '$_POST[goods_desc2]', '$_POST[goods_desc3]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$rank_integral', '$suppliers_id')"
同理,又下面几行
else
{
$sql =$sql = "INSERT INTO. $ecs->table('goods')
这一段中,作上面相同修改如下: $sql = "INSERT INTO " . $ecs->table('goods') . " (goods_name,goods_model, 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_home, is_real, " .
"is_on_sale, is_alone_sale, is_shipping, goods_desc, goods_desc2, goods_desc3, add_time, last_update, goods_type, extension_code, rank_integral)" .
"VALUES ('$_POST[goods_name]','$_POST[goods_model]', '$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', '$is_home', 0, '$is_on_sale', '$is_alone_sale', $is_shipping, ".
" '$_POST[goods_desc]', '$_POST[goods_desc2]', '$_POST[goods_desc3]', '" . gmtime() . "', '". gmtime() ."', '$goods_type', '$code', '$rank_integral')";
2 > 再往下几十行,找到"goods_desc = '$_POST[goods_desc]', " .在其下方再添加二行 ,改成如下 "goods_desc = '$_POST[goods_desc]', " .
"goods_desc2 = '$_POST[goods_desc2]', " .
"goods_desc3 = '$_POST[goods_desc3]', " .
ecshop如何增加多个产品详细描述的编辑器的更多相关文章
- ecshop后台增加模块菜单项详细教程(图文)
有的时候我们会在后台增加新的功能,菜单项是一个程序的入口,是必不可少的,如何在后台增加菜单项呢,大家可以参考下面的教程: 例如:想在后台左侧的菜单栏的"促销管理"下添加一个&q ...
- ecshop商品详细描述调用商品相册代码
该修改方法让用户体验更好,特别是ecshop建站的用户产品描叙文字不多的朋友,直接让相册图显示在产品描述里.免去除在后台添加了 <div style="text-align:cente ...
- ecshop后台增加模块菜单详细教程(图)
我们有时候针对ecshop如此开发,想在后台加一些菜单,最模板以前提供过教程,但是并非很系统,今天最模板抛砖引玉图文教程告诉大家:如何在ecshop后台增加模块菜单! 首先需要修改四个文件:inc_p ...
- ecshop后台增加模块菜单详细教程
我们有时候针对ecshop如此开发,想在后台加一些菜单,最模板以前提供过教程,但是并非很系统,今天最模板抛砖引玉图文教程告诉大家:如何在ecshop后台增加模块菜单! 首先需要修改四个文件:inc_p ...
- 2016 正确 sublime安装PHPcs PHPcodesniffer代码规范提示插件,修正网上部分不详细描述
对你有助请点赞,请顶,不好请踩------送人玫瑰,手留余香!-------------------14:37 2016/3/212016 正确 sublime安装PHPcs PHPcodesniff ...
- ecshop后台增加|添加商店设置选项和使用方法详解
有时候我们想在Ecshop后台做个设置.radio.checkbox 等等来控制页面的显示,看看Ecshop的设计,用到了shop_config这个商店设置功能 Ecshop后台增加|添加商店设置选项 ...
- Ecshop 后台增加一个左侧列表菜单menu菜单的方法
Ecshop 后台增加一个左侧列表菜单menu菜单需要修改三个文件:/admin/includes/inc_menu.php/admin/includes/inc_priv.php/languages ...
- Ecshop、Discuz! 等开源产品的局限
Ecshop.Discuz! 等开源产品的局限 记得今年年初,我初次接触Discuz!和Ecshop时,一阵阵地惊叹:成熟度这么高的产品,居然是免费的.我们这些搞传统软件开发的要怎么活?另外也奇怪,做 ...
- Ecshop的购物流程代码分析详细说明
Ecshop的购物流程代码分析详细说明 (2012-07-30 10:41:12) 转载▼ 标签: 购物车 结算中心 商品价格 ecshop ecshop购物流程 杂谈 分类: ECSHOP研究院 同 ...
随机推荐
- Django_model进阶
Django-model进阶 QuerySet 可切片 使用Python 的切片语法来限制查询集记录的数目 .它等同于SQL 的LIMIT 和OFFSET 子句. >>> Ent ...
- python学习笔记:第三天(数字)
Python3 数字(Number) 1. 数字数据类型 用于存储数值.数据类型是不允许改变的,这就意味着如果改变数字数据类型得值,将重新分配内存空间. 实例在变量赋值时 Number 对象将被创建, ...
- MySQL丨5.6版本插入中文显示问号解决方法
解决办法: 1.找到安装目录下的my-default.ini 这个配置文件 2.copy一份粘贴到同目录下 另命名为my.ini 3.在my.ini 配置下加上下面几句代码 并保存 [mysql]de ...
- hdu-5749 Colmerauer(单调栈)
题目链接: Colmerauer Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Oth ...
- sublime配置java环境
今天突然不想用eclipse编写java了,觉得sublime挺好用,就想用sublime配置java环境,以下是过程以及出现的问题. 一.配置Java环境 1.打开我的电脑–属性–高级–环境变量 2 ...
- mysql :库操作
一 系统数据库 information_schema:虚拟库,不占用磁盘空间,存储的是数据库启动后的一些参数,如用户表信息,列信息, 权限信息, 字符信息等. performance_schema:M ...
- Spring Boot2中配置HTTPS
1.生成证书 使用jdk,jre中的keytool.exe生成自签名的证书,需要配置JAVA_HOME和path环境变量,即jdk的环境变量.命令如下: keytool -genkey -alias ...
- 洛谷 - P3966 - 单词 - AC自动机
https://www.luogu.org/problemnew/show/P3966 因为文本串就是字典本身,所以这个和平时的AC自动机不太一样.平时的query要沿着fail树把子树的出现次数依次 ...
- TP5之页面跳转样式
1.效果图 2.上干货 为了增加对移动设备的支持,在 /application/common.php加入以下函数: function isMobile() { if (isset ($_SERVER ...
- Math对象产生随机数一个小应用
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...